/**
 * @file:          base_math.c
 * @brief:
 * @details:
 * @author:        wjh
 * @date created:  2023.06.29
 * @version:       1.0.0
 * @par copyright (c):
 *
 * @par history (desc):
 *   version:1.0.0, wjh, 2023.06.29,09:27:09
 */

/* Include Files **************************************************************/
#include "base_math.h"
#include "Datatype.h"
#include "stdio.h"

/* Global Variable Define *****************************************************/
// /* X: 8192 */
// const int16 bm_sin_table[] = {
// 0,25,50,75,101,126,151,176,201,226,251,276,302,327,352,377,402,427,452,477,503,528,553,578,603,628,653,679,704,729,754,779,804,829,854,880,905,930,955,980,1005,1030,1055,1080,1106,1131,1156,1181,1206,1231,1256,1281,1307,1332,1357,1382,1407,1432,1457,1482,1507,1532,1558,1583,1608,1633,1658,1683,1708,1733,1758,1783,1809,1834,1859,1884,1909,1934,1959,1984,2009,2034,2059,2085,2110,2135,2160,2185,2210,2235,2260,2285,2310,2335,2360,2385,2410,2436,2461,2486,2511,2536,2561,2586,2611,2636,2661,2686,2711,2736,2761,2786,2811,2836,2861,2886,2911,2936,2962,2987,3012,3037,3062,3087,3112,3137,3162,3187,3212,3237,3262,3287,3312,3337,3362,3387,3412,3437,3462,3487,3512,3537,3562,3587,3612,3637,3662,3687,3712,3737,3761,3786,3811,3836,3861,3886,3911,3936,3961,3986,4011,4036,4061,4086,4111,4136,4161,4186,4210,4235,4260,4285,4310,4335,4360,4385,4410,4435,4460,4485,4509,4534,4559,4584,4609,4634,4659,4684,4708,4733,4758,4783,4808,4833,4858,4882,4907,4932,4957,4982,5007,5032,5056,5081,5106,5131,5156,5180,5205,5230,5255,5280,5305,5329,5354,5379,5404,5428,5453,5478,5503,5528,5552,5577,5602,5627,5651,5676,5701,5726,5750,5775,5800,5825,5849,5874,5899,5924,5948,5973,5998,6022,6047,6072,6096,6121,6146,6171,6195,6220,6245,6269,6294,6319,6343,6368,6393,6417,6442,6466,6491,6516,6540,6565,6590,6614,6639,6663,6688,6713,6737,6762,6786,6811,6836,6860,6885,6909,6934,6958,6983,7008,7032,7057,7081,7106,7130,7155,7179,7204,7228,7253,7277,7302,7326,7351,7375,7400,7424,7449,7473,7498,7522,7547,7571,7596,7620,7644,7669,7693,7718,7742,7767,7791,7815,7840,7864,7889,7913,7937,7962,7986,8010,8035,8059,8084,8108,8132,8157,8181,8205,8230,8254,8278,8303,8327,8351,8375,8400,8424,8448,8473,8497,8521,8545,8570,8594,8618,8642,8667,8691,8715,8739,8764,8788,8812,8836,8860,8885,8909,8933,8957,8981,9006,9030,9054,9078,9102,9126,9150,9175,9199,9223,9247,9271,9295,9319,9343,9367,9391,9416,9440,9464,9488,9512,9536,9560,9584,9608,9632,9656,9680,9704,9728,9752,9776,9800,9824,9848,9872,9896,9920,9944,9968,9992,10016,10039,10063,10087,10111,10135,10159,10183,10207,10231,10255,10278,10302,10326,10350,10374,10398,10421,10445,10469,10493,10517,10541,10564,10588,10612,10636,10659,10683,10707,10731,10754,10778,10802,10826,10849,10873,10897,10920,10944,10968,10992,11015,11039,11063,11086,11110,11133,11157,11181,11204,11228,11252,11275,11299,11322,11346,11370,11393,11417,11440,11464,11487,11511,11534,11558,11581,11605,11628,11652,11675,11699,11722,11746,11769,11793,11816,11840,11863,11886,11910,11933,11957,11980,12003,12027,12050,12074,12097,12120,12144,12167,12190,12214,12237,12260,12284,12307,12330,12353,12377,12400,12423,12446,12470,12493,12516,12539,12563,12586,12609,12632,12655,12679,12702,12725,12748,12771,12794,12817,12841,12864,12887,12910,12933,12956,12979,13002,13025,13048,13071,13094,13118,13141,13164,13187,13210,13233,13256,13279,13302,13324,13347,13370,13393,13416,13439,13462,13485,13508,13531,13554,13577,13599,13622,13645,13668,13691,13714,13736,13759,13782,13805,13828,13850,13873,13896,13919,13942,13964,13987,14010,14032,14055,14078,14101,14123,14146,14169,14191,14214,14236,14259,14282,14304,14327,14350,14372,14395,14417,14440,14462,14485,14507,14530,14553,14575,14598,14620,14643,14665,14688,14710,14732,14755,14777,14800,14822,14845,14867,14889,14912,14934,14956,14979,15001,15024,15046,15068,15090,15113,15135,15157,15180,15202,15224,15246,15269,15291,15313,15335,15358,15380,15402,15424,15446,15468,15491,15513,15535,15557,15579,15601,15623,15645,15667,15690,15712,15734,15756,15778,15800,15822,15844,15866,15888,15910,15932,15954,15976,15997,16019,16041,16063,16085,16107,16129,16151,16173,16195,16216,16238,16260,16282,16304,16325,16347,16369,16391,16413,16434,16456,16478,16499,16521,16543,16565,16586,16608,16630,16651,16673,16694,16716,16738,16759,16781,16802,16824,16846,16867,16889,16910,16932,16953,16975,16996,17018,17039,17061,17082,17104,17125,17146,17168,17189,17211,17232,17253,17275,17296,17317,17339,17360,17381,17403,17424,17445,17467,17488,17509,17530,17551,17573,17594,17615,17636,17657,17679,17700,17721,17742,17763,17784,17805,17827,17848,17869,17890,17911,17932,17953,17974,17995,18016,18037,18058,18079,18100,18121,18142,18163,18183,18204,18225,18246,18267,18288,18309,18330,18350,18371,18392,18413,18434,18454,18475,18496,18517,18537,18558,18579,18599,18620,18641,18661,18682,18703,18723,18744,18765,18785,18806,18826,18847,18868,18888,18909,18929,18950,18970,18991,19011,19032,19052,19072,19093,19113,19134,19154,19174,19195,19215,19236,19256,19276,19297,19317,19337,19357,19378,19398,19418,19438,19459,19479,19499,19519,19539,19560,19580,19600,19620,19640,19660,19680,19700,19721,19741,19761,19781,19801,19821,19841,19861,19881,19901,19921,19941,19961,19981,20000,20020,20040,20060,20080,20100,20120,20139,20159,20179,20199,20219,20238,20258,20278,20298,20317,20337,20357,20377,20396,20416,20436,20455,20475,20494,20514,20534,20553,20573,20592,20612,20631,20651,20670,20690,20709,20729,20748,20768,20787,20807,20826,20845,20865,20884,20904,20923,20942,20962,20981,21000,21019,21039,21058,21077,21096,21116,21135,21154,21173,21192,21212,21231,21250,21269,21288,21307,21326,21345,21364,21383,21403,21422,21441,21460,21479,21498,21516,21535,21554,21573,21592,21611,21630,21649,21668,21687,21705,21724,21743,21762,21781,21799,21818,21837,21856,21874,21893,21912,21930,21949,21968,21986,22005,22024,22042,22061,22079,22098,22116,22135,22154,22172,22191,22209,22227,22246,22264,22283,22301,22320,22338,22356,22375,22393,22411,22430,22448,22466,22485,22503,22521,22540,22558,22576,22594,22612,22631,22649,22667,22685,22703,22721,22739,22757,22776,22794,22812,22830,22848,22866,22884,22902,22920,22938,22956,22973,22991,23009,23027,23045,23063,23081,23099,23116,23134,23152,23170,23188,23205,23223,23241,23258,23276,23294,23311,23329,23347,23364,23382,23400,23417,23435,23452,23470,23487,23505,23522,23540,23557,23575,23592,23610,23627,23645,23662,23679,23697,23714,23731,23749,23766,23783,23801,23818,23835,23852,23870,23887,23904,23921,23938,23956,23973,23990,24007,24024,24041,24058,24075,24092,24109,24126,24143,24160,24177,24194,24211,24228,24245,24262,24279,24296,24312,24329,24346,24363,24380,24397,24413,24430,24447,24464,24480,24497,24514,24530,24547,24564,24580,24597,24613,24630,24647,24663,24680,24696,24713,24729,24746,24762,24779,24795,24811,24828,24844,24861,24877,24893,24910,24926,24942,24959,24975,24991,25007,25024,25040,25056,25072,25088,25105,25121,25137,25153,25169,25185,25201,25217,25233,25249,25265,25281,25297,25313,25329,25345,25361,25377,25393,25409,25425,25440,25456,25472,25488,25504,25519,25535,25551,25567,25582,25598,25614,25629,25645,25661,25676,25692,25708,25723,25739,25754,25770,25785,25801,25816,25832,25847,25863,25878,25893,25909,25924,25940,25955,25970,25986,26001,26016,26031,26047,26062,26077,26092,26108,26123,26138,26153,26168,26183,26198,26214,26229,26244,26259,26274,26289,26304,26319,26334,26349,26364,26378,26393,26408,26423,26438,26453,26468,26482,26497,26512,26527,26542,26556,26571,26586,26600,26615,26630,26644,26659,26674,26688,26703,26717,26732,26746,26761,26775,26790,26804,26819,26833,26848,26862,26876,26891,26905,26919,26934,26948,26962,26977,26991,27005,27019,27034,27048,27062,27076,27090,27104,27118,27133,27147,27161,27175,27189,27203,27217,27231,27245,27259,27273,27287,27300,27314,27328,27342,27356,27370,27384,27397,27411,27425,27439,27452,27466,27480,27493,27507,27521,27534,27548,27562,27575,27589,27602,27616,27629,27643,27656,27670,27683,27697,27710,27724,27737,27750,27764,27777,27790,27804,27817,27830,27843,27857,27870,27883,27896,27910,27923,27936,27949,27962,27975,27988,28001,28014,28027,28040,28053,28066,28079,28092,28105,28118,28131,28144,28157,28170,28182,28195,28208,28221,28234,28246,28259,28272,28284,28297,28310,28322,28335,28348,28360,28373,28385,28398,28411,28423,28436,28448,28460,28473,28485,28498,28510,28523,28535,28547,28560,28572,28584,28596,28609,28621,28633,28645,28658,28670,28682,28694,28706,28718,28730,28742,28755,28767,28779,28791,28803,28815,28827,28838,28850,28862,28874,28886,28898,28910,28922,28933,28945,28957,28969,28980,28992,29004,29016,29027,29039,29050,29062,29074,29085,29097,29108,29120,29131,29143,29154,29166,29177,29189,29200,29212,29223,29234,29246,29257,29268,29280,29291,29302,29313,29325,29336,29347,29358,29369,29380,29392,29403,29414,29425,29436,29447,29458,29469,29480,29491,29502,29513,29524,29534,29545,29556,29567,29578,29589,29599,29610,29621,29632,29642,29653,29664,29675,29685,29696,29706,29717,29728,29738,29749,29759,29770,29780,29791,29801,29812,29822,29832,29843,29853,29864,29874,29884,29894,29905,29915,29925,29936,29946,29956,29966,29976,29986,29997,30007,30017,30027,30037,30047,30057,30067,30077,30087,30097,30107,30117,30126,30136,30146,30156,30166,30176,30185,30195,30205,30215,30224,30234,30244,30253,30263,30273,30282,30292,30302,30311,30321,30330,30340,30349,30359,30368,30377,30387,30396,30406,30415,30424,30434,30443,30452,30462,30471,30480,30489,30498,30508,30517,30526,30535,30544,30553,30562,30571,30580,30589,30598,30607,30616,30625,30634,30643,30652,30661,30670,30679,30687,30696,30705,30714,30723,30731,30740,30749,30757,30766,30775,30783,30792,30800,30809,30818,30826,30835,30843,30852,30860,30868,30877,30885,30894,30902,30910,30919,30927,30935,30944,30952,30960,30968,30977,30985,30993,31001,31009,31017,31025,31033,31041,31050,31058,31066,31074,31082,31089,31097,31105,31113,31121,31129,31137,31145,31152,31160,31168,31176,31183,31191,31199,31206,31214,31222,31229,31237,31245,31252,31260,31267,31275,31282,31290,31297,31305,31312,31319,31327,31334,31341,31349,31356,31363,31371,31378,31385,31392,31400,31407,31414,31421,31428,31435,31442,31449,31456,31463,31470,31477,31484,31491,31498,31505,31512,31519,31526,31533,31539,31546,31553,31560,31567,31573,31580,31587,31593,31600,31607,31613,31620,31627,31633,31640,31646,31653,31659,31666,31672,31679,31685,31691,31698,31704,31710,31717,31723,31729,31736,31742,31748,31754,31760,31767,31773,31779,31785,31791,31797,31803,31809,31815,31821,31827,31833,31839,31845,31851,31857,31863,31869,31875,31880,31886,31892,31898,31903,31909,31915,31921,31926,31932,31937,31943,31949,31954,31960,31965,31971,31976,31982,31987,31993,31998,32004,32009,32014,32020,32025,32030,32036,32041,32046,32051,32057,32062,32067,32072,32077,32082,32087,32092,32098,32103,32108,32113,32118,32123,32128,32132,32137,32142,32147,32152,32157,32162,32166,32171,32176,32181,32185,32190,32195,32200,32204,32209,32213,32218,32223,32227,32232,32236,32241,32245,32250,32254,32258,32263,32267,32272,32276,32280,32285,32289,32293,32297,32302,32306,32310,32314,32318,32322,32327,32331,32335,32339,32343,32347,32351,32355,32359,32363,32367,32371,32375,32378,32382,32386,32390,32394,32397,32401,32405,32409,32412,32416,32420,32423,32427,32431,32434,32438,32441,32445,32448,32452,32455,32459,32462,32466,32469,32472,32476,32479,32482,32486,32489,32492,32495,32499,32502,32505,32508,32511,32514,32517,32521,32524,32527,32530,32533,32536,32539,32542,32545,32547,32550,32553,32556,32559,32562,32565,32567,32570,32573,32576,32578,32581,32584,32586,32589,32592,32594,32597,32599,32602,32604,32607,32609,32612,32614,32617,32619,32621,32624,32626,32628,32631,32633,32635,32637,32640,32642,32644,32646,32648,32650,32653,32655,32657,32659,32661,32663,32665,32667,32669,32671,32673,32674,32676,32678,32680,32682,32684,32685,32687,32689,32691,32692,32694,32696,32697,32699,32701,32702,32704,32705,32707,32708,32710,32711,32713,32714,32716,32717,32718,32720,32721,32722,32724,32725,32726,32728,32729,32730,32731,32732,32733,32735,32736,32737,32738,32739,32740,32741,32742,32743,32744,32745,32746,32747,32747,32748,32749,32750,32751,32752,32752,32753,32754,32755,32755,32756,32757,32757,32758,32758,32759,32759,32760,32760,32761,32761,32762,32762,32763,32763,32764,32764,32764,32765,32765,32765,32765,32766,32766,32766,32766,32766,32767,32767,32767,32767,32767,32767,32767,
// 32767,32767,32767,32767,32767,32767,32767,32767,32766,32766,32766,32766,32766,32765,32765,32765,32765,32764,32764,32764,32763,32763,32762,32762,32761,32761,32760,32760,32759,32759,32758,32758,32757,32757,32756,32755,32755,32754,32753,32752,32752,32751,32750,32749,32748,32747,32747,32746,32745,32744,32743,32742,32741,32740,32739,32738,32737,32736,32735,32733,32732,32731,32730,32729,32728,32726,32725,32724,32722,32721,32720,32718,32717,32716,32714,32713,32711,32710,32708,32707,32705,32704,32702,32701,32699,32697,32696,32694,32692,32691,32689,32687,32685,32684,32682,32680,32678,32676,32674,32673,32671,32669,32667,32665,32663,32661,32659,32657,32655,32653,32650,32648,32646,32644,32642,32640,32637,32635,32633,32631,32628,32626,32624,32621,32619,32617,32614,32612,32609,32607,32604,32602,32599,32597,32594,32592,32589,32586,32584,32581,32578,32576,32573,32570,32567,32565,32562,32559,32556,32553,32550,32547,32545,32542,32539,32536,32533,32530,32527,32524,32521,32517,32514,32511,32508,32505,32502,32499,32495,32492,32489,32486,32482,32479,32476,32472,32469,32466,32462,32459,32455,32452,32448,32445,32441,32438,32434,32431,32427,32423,32420,32416,32412,32409,32405,32401,32397,32394,32390,32386,32382,32378,32375,32371,32367,32363,32359,32355,32351,32347,32343,32339,32335,32331,32327,32322,32318,32314,32310,32306,32302,32297,32293,32289,32285,32280,32276,32272,32267,32263,32258,32254,32250,32245,32241,32236,32232,32227,32223,32218,32213,32209,32204,32200,32195,32190,32185,32181,32176,32171,32166,32162,32157,32152,32147,32142,32137,32132,32128,32123,32118,32113,32108,32103,32098,32092,32087,32082,32077,32072,32067,32062,32057,32051,32046,32041,32036,32030,32025,32020,32014,32009,32004,31998,31993,31987,31982,31976,31971,31965,31960,31954,31949,31943,31937,31932,31926,31921,31915,31909,31903,31898,31892,31886,31880,31875,31869,31863,31857,31851,31845,31839,31833,31827,31821,31815,31809,31803,31797,31791,31785,31779,31773,31767,31760,31754,31748,31742,31736,31729,31723,31717,31710,31704,31698,31691,31685,31679,31672,31666,31659,31653,31646,31640,31633,31627,31620,31613,31607,31600,31593,31587,31580,31573,31567,31560,31553,31546,31539,31533,31526,31519,31512,31505,31498,31491,31484,31477,31470,31463,31456,31449,31442,31435,31428,31421,31414,31407,31400,31392,31385,31378,31371,31363,31356,31349,31341,31334,31327,31319,31312,31305,31297,31290,31282,31275,31267,31260,31252,31245,31237,31229,31222,31214,31206,31199,31191,31183,31176,31168,31160,31152,31145,31137,31129,31121,31113,31105,31097,31089,31082,31074,31066,31058,31050,31041,31033,31025,31017,31009,31001,30993,30985,30977,30968,30960,30952,30944,30935,30927,30919,30910,30902,30894,30885,30877,30868,30860,30852,30843,30835,30826,30818,30809,30800,30792,30783,30775,30766,30757,30749,30740,30731,30723,30714,30705,30696,30687,30679,30670,30661,30652,30643,30634,30625,30616,30607,30598,30589,30580,30571,30562,30553,30544,30535,30526,30517,30508,30498,30489,30480,30471,30462,30452,30443,30434,30424,30415,30406,30396,30387,30377,30368,30359,30349,30340,30330,30321,30311,30302,30292,30282,30273,30263,30253,30244,30234,30224,30215,30205,30195,30185,30176,30166,30156,30146,30136,30126,30117,30107,30097,30087,30077,30067,30057,30047,30037,30027,30017,30007,29997,29986,29976,29966,29956,29946,29936,29925,29915,29905,29894,29884,29874,29864,29853,29843,29832,29822,29812,29801,29791,29780,29770,29759,29749,29738,29728,29717,29706,29696,29685,29675,29664,29653,29642,29632,29621,29610,29599,29589,29578,29567,29556,29545,29534,29524,29513,29502,29491,29480,29469,29458,29447,29436,29425,29414,29403,29392,29380,29369,29358,29347,29336,29325,29313,29302,29291,29280,29268,29257,29246,29234,29223,29212,29200,29189,29177,29166,29154,29143,29131,29120,29108,29097,29085,29074,29062,29050,29039,29027,29016,29004,28992,28980,28969,28957,28945,28933,28922,28910,28898,28886,28874,28862,28850,28838,28827,28815,28803,28791,28779,28767,28755,28742,28730,28718,28706,28694,28682,28670,28658,28645,28633,28621,28609,28596,28584,28572,28560,28547,28535,28523,28510,28498,28485,28473,28460,28448,28436,28423,28411,28398,28385,28373,28360,28348,28335,28322,28310,28297,28284,28272,28259,28246,28234,28221,28208,28195,28182,28170,28157,28144,28131,28118,28105,28092,28079,28066,28053,28040,28027,28014,28001,27988,27975,27962,27949,27936,27923,27910,27896,27883,27870,27857,27843,27830,27817,27804,27790,27777,27764,27750,27737,27724,27710,27697,27683,27670,27656,27643,27629,27616,27602,27589,27575,27562,27548,27534,27521,27507,27493,27480,27466,27452,27439,27425,27411,27397,27384,27370,27356,27342,27328,27314,27300,27287,27273,27259,27245,27231,27217,27203,27189,27175,27161,27147,27133,27118,27104,27090,27076,27062,27048,27034,27019,27005,26991,26977,26962,26948,26934,26919,26905,26891,26876,26862,26848,26833,26819,26804,26790,26775,26761,26746,26732,26717,26703,26688,26674,26659,26644,26630,26615,26600,26586,26571,26556,26542,26527,26512,26497,26482,26468,26453,26438,26423,26408,26393,26378,26364,26349,26334,26319,26304,26289,26274,26259,26244,26229,26214,26198,26183,26168,26153,26138,26123,26108,26092,26077,26062,26047,26031,26016,26001,25986,25970,25955,25940,25924,25909,25893,25878,25863,25847,25832,25816,25801,25785,25770,25754,25739,25723,25708,25692,25676,25661,25645,25629,25614,25598,25582,25567,25551,25535,25519,25504,25488,25472,25456,25440,25425,25409,25393,25377,25361,25345,25329,25313,25297,25281,25265,25249,25233,25217,25201,25185,25169,25153,25137,25121,25105,25088,25072,25056,25040,25024,25007,24991,24975,24959,24942,24926,24910,24893,24877,24861,24844,24828,24811,24795,24779,24762,24746,24729,24713,24696,24680,24663,24647,24630,24613,24597,24580,24564,24547,24530,24514,24497,24480,24464,24447,24430,24413,24397,24380,24363,24346,24329,24312,24296,24279,24262,24245,24228,24211,24194,24177,24160,24143,24126,24109,24092,24075,24058,24041,24024,24007,23990,23973,23956,23938,23921,23904,23887,23870,23852,23835,23818,23801,23783,23766,23749,23731,23714,23697,23679,23662,23645,23627,23610,23592,23575,23557,23540,23522,23505,23487,23470,23452,23435,23417,23400,23382,23364,23347,23329,23311,23294,23276,23258,23241,23223,23205,23188,23170,23152,23134,23116,23099,23081,23063,23045,23027,23009,22991,22973,22956,22938,22920,22902,22884,22866,22848,22830,22812,22794,22776,22757,22739,22721,22703,22685,22667,22649,22631,22612,22594,22576,22558,22540,22521,22503,22485,22466,22448,22430,22411,22393,22375,22356,22338,22320,22301,22283,22264,22246,22227,22209,22191,22172,22154,22135,22116,22098,22079,22061,22042,22024,22005,21986,21968,21949,21930,21912,21893,21874,21856,21837,21818,21799,21781,21762,21743,21724,21705,21687,21668,21649,21630,21611,21592,21573,21554,21535,21516,21498,21479,21460,21441,21422,21403,21383,21364,21345,21326,21307,21288,21269,21250,21231,21212,21192,21173,21154,21135,21116,21096,21077,21058,21039,21019,21000,20981,20962,20942,20923,20904,20884,20865,20845,20826,20807,20787,20768,20748,20729,20709,20690,20670,20651,20631,20612,20592,20573,20553,20534,20514,20494,20475,20455,20436,20416,20396,20377,20357,20337,20317,20298,20278,20258,20238,20219,20199,20179,20159,20139,20120,20100,20080,20060,20040,20020,20000,19981,19961,19941,19921,19901,19881,19861,19841,19821,19801,19781,19761,19741,19721,19700,19680,19660,19640,19620,19600,19580,19560,19539,19519,19499,19479,19459,19438,19418,19398,19378,19357,19337,19317,19297,19276,19256,19236,19215,19195,19174,19154,19134,19113,19093,19072,19052,19032,19011,18991,18970,18950,18929,18909,18888,18868,18847,18826,18806,18785,18765,18744,18723,18703,18682,18661,18641,18620,18599,18579,18558,18537,18517,18496,18475,18454,18434,18413,18392,18371,18350,18330,18309,18288,18267,18246,18225,18204,18183,18163,18142,18121,18100,18079,18058,18037,18016,17995,17974,17953,17932,17911,17890,17869,17848,17827,17805,17784,17763,17742,17721,17700,17679,17657,17636,17615,17594,17573,17551,17530,17509,17488,17467,17445,17424,17403,17381,17360,17339,17317,17296,17275,17253,17232,17211,17189,17168,17146,17125,17104,17082,17061,17039,17018,16996,16975,16953,16932,16910,16889,16867,16846,16824,16802,16781,16759,16738,16716,16694,16673,16651,16630,16608,16586,16565,16543,16521,16499,16478,16456,16434,16413,16391,16369,16347,16325,16304,16282,16260,16238,16216,16195,16173,16151,16129,16107,16085,16063,16041,16019,15997,15976,15954,15932,15910,15888,15866,15844,15822,15800,15778,15756,15734,15712,15690,15667,15645,15623,15601,15579,15557,15535,15513,15491,15468,15446,15424,15402,15380,15358,15335,15313,15291,15269,15246,15224,15202,15180,15157,15135,15113,15090,15068,15046,15024,15001,14979,14956,14934,14912,14889,14867,14845,14822,14800,14777,14755,14732,14710,14688,14665,14643,14620,14598,14575,14553,14530,14507,14485,14462,14440,14417,14395,14372,14350,14327,14304,14282,14259,14236,14214,14191,14169,14146,14123,14101,14078,14055,14032,14010,13987,13964,13942,13919,13896,13873,13850,13828,13805,13782,13759,13736,13714,13691,13668,13645,13622,13599,13577,13554,13531,13508,13485,13462,13439,13416,13393,13370,13347,13324,13302,13279,13256,13233,13210,13187,13164,13141,13118,13094,13071,13048,13025,13002,12979,12956,12933,12910,12887,12864,12841,12817,12794,12771,12748,12725,12702,12679,12655,12632,12609,12586,12563,12539,12516,12493,12470,12446,12423,12400,12377,12353,12330,12307,12284,12260,12237,12214,12190,12167,12144,12120,12097,12074,12050,12027,12003,11980,11957,11933,11910,11886,11863,11840,11816,11793,11769,11746,11722,11699,11675,11652,11628,11605,11581,11558,11534,11511,11487,11464,11440,11417,11393,11370,11346,11322,11299,11275,11252,11228,11204,11181,11157,11133,11110,11086,11063,11039,11015,10992,10968,10944,10920,10897,10873,10849,10826,10802,10778,10754,10731,10707,10683,10659,10636,10612,10588,10564,10541,10517,10493,10469,10445,10421,10398,10374,10350,10326,10302,10278,10255,10231,10207,10183,10159,10135,10111,10087,10063,10039,10016,9992,9968,9944,9920,9896,9872,9848,9824,9800,9776,9752,9728,9704,9680,9656,9632,9608,9584,9560,9536,9512,9488,9464,9440,9416,9391,9367,9343,9319,9295,9271,9247,9223,9199,9175,9150,9126,9102,9078,9054,9030,9006,8981,8957,8933,8909,8885,8860,8836,8812,8788,8764,8739,8715,8691,8667,8642,8618,8594,8570,8545,8521,8497,8473,8448,8424,8400,8375,8351,8327,8303,8278,8254,8230,8205,8181,8157,8132,8108,8084,8059,8035,8010,7986,7962,7937,7913,7889,7864,7840,7815,7791,7767,7742,7718,7693,7669,7644,7620,7596,7571,7547,7522,7498,7473,7449,7424,7400,7375,7351,7326,7302,7277,7253,7228,7204,7179,7155,7130,7106,7081,7057,7032,7008,6983,6958,6934,6909,6885,6860,6836,6811,6786,6762,6737,6713,6688,6663,6639,6614,6590,6565,6540,6516,6491,6466,6442,6417,6393,6368,6343,6319,6294,6269,6245,6220,6195,6171,6146,6121,6096,6072,6047,6022,5998,5973,5948,5924,5899,5874,5849,5825,5800,5775,5750,5726,5701,5676,5651,5627,5602,5577,5552,5528,5503,5478,5453,5428,5404,5379,5354,5329,5305,5280,5255,5230,5205,5180,5156,5131,5106,5081,5056,5032,5007,4982,4957,4932,4907,4882,4858,4833,4808,4783,4758,4733,4708,4684,4659,4634,4609,4584,4559,4534,4509,4485,4460,4435,4410,4385,4360,4335,4310,4285,4260,4235,4210,4186,4161,4136,4111,4086,4061,4036,4011,3986,3961,3936,3911,3886,3861,3836,3811,3786,3761,3737,3712,3687,3662,3637,3612,3587,3562,3537,3512,3487,3462,3437,3412,3387,3362,3337,3312,3287,3262,3237,3212,3187,3162,3137,3112,3087,3062,3037,3012,2987,2962,2936,2911,2886,2861,2836,2811,2786,2761,2736,2711,2686,2661,2636,2611,2586,2561,2536,2511,2486,2461,2436,2410,2385,2360,2335,2310,2285,2260,2235,2210,2185,2160,2135,2110,2085,2059,2034,2009,1984,1959,1934,1909,1884,1859,1834,1809,1783,1758,1733,1708,1683,1658,1633,1608,1583,1558,1532,1507,1482,1457,1432,1407,1382,1357,1332,1307,1281,1256,1231,1206,1181,1156,1131,1106,1080,1055,1030,1005,980,955,930,905,880,854,829,804,779,754,729,704,679,653,628,603,578,553,528,503,477,452,427,402,377,352,327,302,276,251,226,201,176,151,126,101,75,50,25,
// 0,-25,-50,-75,-101,-126,-151,-176,-201,-226,-251,-276,-302,-327,-352,-377,-402,-427,-452,-477,-503,-528,-553,-578,-603,-628,-653,-679,-704,-729,-754,-779,-804,-829,-854,-880,-905,-930,-955,-980,-1005,-1030,-1055,-1080,-1106,-1131,-1156,-1181,-1206,-1231,-1256,-1281,-1307,-1332,-1357,-1382,-1407,-1432,-1457,-1482,-1507,-1532,-1558,-1583,-1608,-1633,-1658,-1683,-1708,-1733,-1758,-1783,-1809,-1834,-1859,-1884,-1909,-1934,-1959,-1984,-2009,-2034,-2059,-2085,-2110,-2135,-2160,-2185,-2210,-2235,-2260,-2285,-2310,-2335,-2360,-2385,-2410,-2436,-2461,-2486,-2511,-2536,-2561,-2586,-2611,-2636,-2661,-2686,-2711,-2736,-2761,-2786,-2811,-2836,-2861,-2886,-2911,-2936,-2962,-2987,-3012,-3037,-3062,-3087,-3112,-3137,-3162,-3187,-3212,-3237,-3262,-3287,-3312,-3337,-3362,-3387,-3412,-3437,-3462,-3487,-3512,-3537,-3562,-3587,-3612,-3637,-3662,-3687,-3712,-3737,-3761,-3786,-3811,-3836,-3861,-3886,-3911,-3936,-3961,-3986,-4011,-4036,-4061,-4086,-4111,-4136,-4161,-4186,-4210,-4235,-4260,-4285,-4310,-4335,-4360,-4385,-4410,-4435,-4460,-4485,-4509,-4534,-4559,-4584,-4609,-4634,-4659,-4684,-4708,-4733,-4758,-4783,-4808,-4833,-4858,-4882,-4907,-4932,-4957,-4982,-5007,-5032,-5056,-5081,-5106,-5131,-5156,-5180,-5205,-5230,-5255,-5280,-5305,-5329,-5354,-5379,-5404,-5428,-5453,-5478,-5503,-5528,-5552,-5577,-5602,-5627,-5651,-5676,-5701,-5726,-5750,-5775,-5800,-5825,-5849,-5874,-5899,-5924,-5948,-5973,-5998,-6022,-6047,-6072,-6096,-6121,-6146,-6171,-6195,-6220,-6245,-6269,-6294,-6319,-6343,-6368,-6393,-6417,-6442,-6466,-6491,-6516,-6540,-6565,-6590,-6614,-6639,-6663,-6688,-6713,-6737,-6762,-6786,-6811,-6836,-6860,-6885,-6909,-6934,-6958,-6983,-7008,-7032,-7057,-7081,-7106,-7130,-7155,-7179,-7204,-7228,-7253,-7277,-7302,-7326,-7351,-7375,-7400,-7424,-7449,-7473,-7498,-7522,-7547,-7571,-7596,-7620,-7644,-7669,-7693,-7718,-7742,-7767,-7791,-7815,-7840,-7864,-7889,-7913,-7937,-7962,-7986,-8010,-8035,-8059,-8084,-8108,-8132,-8157,-8181,-8205,-8230,-8254,-8278,-8303,-8327,-8351,-8375,-8400,-8424,-8448,-8473,-8497,-8521,-8545,-8570,-8594,-8618,-8642,-8667,-8691,-8715,-8739,-8764,-8788,-8812,-8836,-8860,-8885,-8909,-8933,-8957,-8981,-9006,-9030,-9054,-9078,-9102,-9126,-9150,-9175,-9199,-9223,-9247,-9271,-9295,-9319,-9343,-9367,-9391,-9416,-9440,-9464,-9488,-9512,-9536,-9560,-9584,-9608,-9632,-9656,-9680,-9704,-9728,-9752,-9776,-9800,-9824,-9848,-9872,-9896,-9920,-9944,-9968,-9992,-10016,-10039,-10063,-10087,-10111,-10135,-10159,-10183,-10207,-10231,-10255,-10278,-10302,-10326,-10350,-10374,-10398,-10421,-10445,-10469,-10493,-10517,-10541,-10564,-10588,-10612,-10636,-10659,-10683,-10707,-10731,-10754,-10778,-10802,-10826,-10849,-10873,-10897,-10920,-10944,-10968,-10992,-11015,-11039,-11063,-11086,-11110,-11133,-11157,-11181,-11204,-11228,-11252,-11275,-11299,-11322,-11346,-11370,-11393,-11417,-11440,-11464,-11487,-11511,-11534,-11558,-11581,-11605,-11628,-11652,-11675,-11699,-11722,-11746,-11769,-11793,-11816,-11840,-11863,-11886,-11910,-11933,-11957,-11980,-12003,-12027,-12050,-12074,-12097,-12120,-12144,-12167,-12190,-12214,-12237,-12260,-12284,-12307,-12330,-12353,-12377,-12400,-12423,-12446,-12470,-12493,-12516,-12539,-12563,-12586,-12609,-12632,-12655,-12679,-12702,-12725,-12748,-12771,-12794,-12817,-12841,-12864,-12887,-12910,-12933,-12956,-12979,-13002,-13025,-13048,-13071,-13094,-13118,-13141,-13164,-13187,-13210,-13233,-13256,-13279,-13302,-13324,-13347,-13370,-13393,-13416,-13439,-13462,-13485,-13508,-13531,-13554,-13577,-13599,-13622,-13645,-13668,-13691,-13714,-13736,-13759,-13782,-13805,-13828,-13850,-13873,-13896,-13919,-13942,-13964,-13987,-14010,-14032,-14055,-14078,-14101,-14123,-14146,-14169,-14191,-14214,-14236,-14259,-14282,-14304,-14327,-14350,-14372,-14395,-14417,-14440,-14462,-14485,-14507,-14530,-14553,-14575,-14598,-14620,-14643,-14665,-14688,-14710,-14732,-14755,-14777,-14800,-14822,-14845,-14867,-14889,-14912,-14934,-14956,-14979,-15001,-15024,-15046,-15068,-15090,-15113,-15135,-15157,-15180,-15202,-15224,-15246,-15269,-15291,-15313,-15335,-15358,-15380,-15402,-15424,-15446,-15468,-15491,-15513,-15535,-15557,-15579,-15601,-15623,-15645,-15667,-15690,-15712,-15734,-15756,-15778,-15800,-15822,-15844,-15866,-15888,-15910,-15932,-15954,-15976,-15997,-16019,-16041,-16063,-16085,-16107,-16129,-16151,-16173,-16195,-16216,-16238,-16260,-16282,-16304,-16325,-16347,-16369,-16391,-16413,-16434,-16456,-16478,-16499,-16521,-16543,-16565,-16586,-16608,-16630,-16651,-16673,-16694,-16716,-16738,-16759,-16781,-16802,-16824,-16846,-16867,-16889,-16910,-16932,-16953,-16975,-16996,-17018,-17039,-17061,-17082,-17104,-17125,-17146,-17168,-17189,-17211,-17232,-17253,-17275,-17296,-17317,-17339,-17360,-17381,-17403,-17424,-17445,-17467,-17488,-17509,-17530,-17551,-17573,-17594,-17615,-17636,-17657,-17679,-17700,-17721,-17742,-17763,-17784,-17805,-17827,-17848,-17869,-17890,-17911,-17932,-17953,-17974,-17995,-18016,-18037,-18058,-18079,-18100,-18121,-18142,-18163,-18183,-18204,-18225,-18246,-18267,-18288,-18309,-18330,-18350,-18371,-18392,-18413,-18434,-18454,-18475,-18496,-18517,-18537,-18558,-18579,-18599,-18620,-18641,-18661,-18682,-18703,-18723,-18744,-18765,-18785,-18806,-18826,-18847,-18868,-18888,-18909,-18929,-18950,-18970,-18991,-19011,-19032,-19052,-19072,-19093,-19113,-19134,-19154,-19174,-19195,-19215,-19236,-19256,-19276,-19297,-19317,-19337,-19357,-19378,-19398,-19418,-19438,-19459,-19479,-19499,-19519,-19539,-19560,-19580,-19600,-19620,-19640,-19660,-19680,-19700,-19721,-19741,-19761,-19781,-19801,-19821,-19841,-19861,-19881,-19901,-19921,-19941,-19961,-19981,-20000,-20020,-20040,-20060,-20080,-20100,-20120,-20139,-20159,-20179,-20199,-20219,-20238,-20258,-20278,-20298,-20317,-20337,-20357,-20377,-20396,-20416,-20436,-20455,-20475,-20494,-20514,-20534,-20553,-20573,-20592,-20612,-20631,-20651,-20670,-20690,-20709,-20729,-20748,-20768,-20787,-20807,-20826,-20845,-20865,-20884,-20904,-20923,-20942,-20962,-20981,-21000,-21019,-21039,-21058,-21077,-21096,-21116,-21135,-21154,-21173,-21192,-21212,-21231,-21250,-21269,-21288,-21307,-21326,-21345,-21364,-21383,-21403,-21422,-21441,-21460,-21479,-21498,-21516,-21535,-21554,-21573,-21592,-21611,-21630,-21649,-21668,-21687,-21705,-21724,-21743,-21762,-21781,-21799,-21818,-21837,-21856,-21874,-21893,-21912,-21930,-21949,-21968,-21986,-22005,-22024,-22042,-22061,-22079,-22098,-22116,-22135,-22154,-22172,-22191,-22209,-22227,-22246,-22264,-22283,-22301,-22320,-22338,-22356,-22375,-22393,-22411,-22430,-22448,-22466,-22485,-22503,-22521,-22540,-22558,-22576,-22594,-22612,-22631,-22649,-22667,-22685,-22703,-22721,-22739,-22757,-22776,-22794,-22812,-22830,-22848,-22866,-22884,-22902,-22920,-22938,-22956,-22973,-22991,-23009,-23027,-23045,-23063,-23081,-23099,-23116,-23134,-23152,-23170,-23188,-23205,-23223,-23241,-23258,-23276,-23294,-23311,-23329,-23347,-23364,-23382,-23400,-23417,-23435,-23452,-23470,-23487,-23505,-23522,-23540,-23557,-23575,-23592,-23610,-23627,-23645,-23662,-23679,-23697,-23714,-23731,-23749,-23766,-23783,-23801,-23818,-23835,-23852,-23870,-23887,-23904,-23921,-23938,-23956,-23973,-23990,-24007,-24024,-24041,-24058,-24075,-24092,-24109,-24126,-24143,-24160,-24177,-24194,-24211,-24228,-24245,-24262,-24279,-24296,-24312,-24329,-24346,-24363,-24380,-24397,-24413,-24430,-24447,-24464,-24480,-24497,-24514,-24530,-24547,-24564,-24580,-24597,-24613,-24630,-24647,-24663,-24680,-24696,-24713,-24729,-24746,-24762,-24779,-24795,-24811,-24828,-24844,-24861,-24877,-24893,-24910,-24926,-24942,-24959,-24975,-24991,-25007,-25024,-25040,-25056,-25072,-25088,-25105,-25121,-25137,-25153,-25169,-25185,-25201,-25217,-25233,-25249,-25265,-25281,-25297,-25313,-25329,-25345,-25361,-25377,-25393,-25409,-25425,-25440,-25456,-25472,-25488,-25504,-25519,-25535,-25551,-25567,-25582,-25598,-25614,-25629,-25645,-25661,-25676,-25692,-25708,-25723,-25739,-25754,-25770,-25785,-25801,-25816,-25832,-25847,-25863,-25878,-25893,-25909,-25924,-25940,-25955,-25970,-25986,-26001,-26016,-26031,-26047,-26062,-26077,-26092,-26108,-26123,-26138,-26153,-26168,-26183,-26198,-26214,-26229,-26244,-26259,-26274,-26289,-26304,-26319,-26334,-26349,-26364,-26378,-26393,-26408,-26423,-26438,-26453,-26468,-26482,-26497,-26512,-26527,-26542,-26556,-26571,-26586,-26600,-26615,-26630,-26644,-26659,-26674,-26688,-26703,-26717,-26732,-26746,-26761,-26775,-26790,-26804,-26819,-26833,-26848,-26862,-26876,-26891,-26905,-26919,-26934,-26948,-26962,-26977,-26991,-27005,-27019,-27034,-27048,-27062,-27076,-27090,-27104,-27118,-27133,-27147,-27161,-27175,-27189,-27203,-27217,-27231,-27245,-27259,-27273,-27287,-27300,-27314,-27328,-27342,-27356,-27370,-27384,-27397,-27411,-27425,-27439,-27452,-27466,-27480,-27493,-27507,-27521,-27534,-27548,-27562,-27575,-27589,-27602,-27616,-27629,-27643,-27656,-27670,-27683,-27697,-27710,-27724,-27737,-27750,-27764,-27777,-27790,-27804,-27817,-27830,-27843,-27857,-27870,-27883,-27896,-27910,-27923,-27936,-27949,-27962,-27975,-27988,-28001,-28014,-28027,-28040,-28053,-28066,-28079,-28092,-28105,-28118,-28131,-28144,-28157,-28170,-28182,-28195,-28208,-28221,-28234,-28246,-28259,-28272,-28284,-28297,-28310,-28322,-28335,-28348,-28360,-28373,-28385,-28398,-28411,-28423,-28436,-28448,-28460,-28473,-28485,-28498,-28510,-28523,-28535,-28547,-28560,-28572,-28584,-28596,-28609,-28621,-28633,-28645,-28658,-28670,-28682,-28694,-28706,-28718,-28730,-28742,-28755,-28767,-28779,-28791,-28803,-28815,-28827,-28838,-28850,-28862,-28874,-28886,-28898,-28910,-28922,-28933,-28945,-28957,-28969,-28980,-28992,-29004,-29016,-29027,-29039,-29050,-29062,-29074,-29085,-29097,-29108,-29120,-29131,-29143,-29154,-29166,-29177,-29189,-29200,-29212,-29223,-29234,-29246,-29257,-29268,-29280,-29291,-29302,-29313,-29325,-29336,-29347,-29358,-29369,-29380,-29392,-29403,-29414,-29425,-29436,-29447,-29458,-29469,-29480,-29491,-29502,-29513,-29524,-29534,-29545,-29556,-29567,-29578,-29589,-29599,-29610,-29621,-29632,-29642,-29653,-29664,-29675,-29685,-29696,-29706,-29717,-29728,-29738,-29749,-29759,-29770,-29780,-29791,-29801,-29812,-29822,-29832,-29843,-29853,-29864,-29874,-29884,-29894,-29905,-29915,-29925,-29936,-29946,-29956,-29966,-29976,-29986,-29997,-30007,-30017,-30027,-30037,-30047,-30057,-30067,-30077,-30087,-30097,-30107,-30117,-30126,-30136,-30146,-30156,-30166,-30176,-30185,-30195,-30205,-30215,-30224,-30234,-30244,-30253,-30263,-30273,-30282,-30292,-30302,-30311,-30321,-30330,-30340,-30349,-30359,-30368,-30377,-30387,-30396,-30406,-30415,-30424,-30434,-30443,-30452,-30462,-30471,-30480,-30489,-30498,-30508,-30517,-30526,-30535,-30544,-30553,-30562,-30571,-30580,-30589,-30598,-30607,-30616,-30625,-30634,-30643,-30652,-30661,-30670,-30679,-30687,-30696,-30705,-30714,-30723,-30731,-30740,-30749,-30757,-30766,-30775,-30783,-30792,-30800,-30809,-30818,-30826,-30835,-30843,-30852,-30860,-30868,-30877,-30885,-30894,-30902,-30910,-30919,-30927,-30935,-30944,-30952,-30960,-30968,-30977,-30985,-30993,-31001,-31009,-31017,-31025,-31033,-31041,-31050,-31058,-31066,-31074,-31082,-31089,-31097,-31105,-31113,-31121,-31129,-31137,-31145,-31152,-31160,-31168,-31176,-31183,-31191,-31199,-31206,-31214,-31222,-31229,-31237,-31245,-31252,-31260,-31267,-31275,-31282,-31290,-31297,-31305,-31312,-31319,-31327,-31334,-31341,-31349,-31356,-31363,-31371,-31378,-31385,-31392,-31400,-31407,-31414,-31421,-31428,-31435,-31442,-31449,-31456,-31463,-31470,-31477,-31484,-31491,-31498,-31505,-31512,-31519,-31526,-31533,-31539,-31546,-31553,-31560,-31567,-31573,-31580,-31587,-31593,-31600,-31607,-31613,-31620,-31627,-31633,-31640,-31646,-31653,-31659,-31666,-31672,-31679,-31685,-31691,-31698,-31704,-31710,-31717,-31723,-31729,-31736,-31742,-31748,-31754,-31760,-31767,-31773,-31779,-31785,-31791,-31797,-31803,-31809,-31815,-31821,-31827,-31833,-31839,-31845,-31851,-31857,-31863,-31869,-31875,-31880,-31886,-31892,-31898,-31903,-31909,-31915,-31921,-31926,-31932,-31937,-31943,-31949,-31954,-31960,-31965,-31971,-31976,-31982,-31987,-31993,-31998,-32004,-32009,-32014,-32020,-32025,-32030,-32036,-32041,-32046,-32051,-32057,-32062,-32067,-32072,-32077,-32082,-32087,-32092,-32098,-32103,-32108,-32113,-32118,-32123,-32128,-32132,-32137,-32142,-32147,-32152,-32157,-32162,-32166,-32171,-32176,-32181,-32185,-32190,-32195,-32200,-32204,-32209,-32213,-32218,-32223,-32227,-32232,-32236,-32241,-32245,-32250,-32254,-32258,-32263,-32267,-32272,-32276,-32280,-32285,-32289,-32293,-32297,-32302,-32306,-32310,-32314,-32318,-32322,-32327,-32331,-32335,-32339,-32343,-32347,-32351,-32355,-32359,-32363,-32367,-32371,-32375,-32378,-32382,-32386,-32390,-32394,-32397,-32401,-32405,-32409,-32412,-32416,-32420,-32423,-32427,-32431,-32434,-32438,-32441,-32445,-32448,-32452,-32455,-32459,-32462,-32466,-32469,-32472,-32476,-32479,-32482,-32486,-32489,-32492,-32495,-32499,-32502,-32505,-32508,-32511,-32514,-32517,-32521,-32524,-32527,-32530,-32533,-32536,-32539,-32542,-32545,-32547,-32550,-32553,-32556,-32559,-32562,-32565,-32567,-32570,-32573,-32576,-32578,-32581,-32584,-32586,-32589,-32592,-32594,-32597,-32599,-32602,-32604,-32607,-32609,-32612,-32614,-32617,-32619,-32621,-32624,-32626,-32628,-32631,-32633,-32635,-32637,-32640,-32642,-32644,-32646,-32648,-32650,-32653,-32655,-32657,-32659,-32661,-32663,-32665,-32667,-32669,-32671,-32673,-32674,-32676,-32678,-32680,-32682,-32684,-32685,-32687,-32689,-32691,-32692,-32694,-32696,-32697,-32699,-32701,-32702,-32704,-32705,-32707,-32708,-32710,-32711,-32713,-32714,-32716,-32717,-32718,-32720,-32721,-32722,-32724,-32725,-32726,-32728,-32729,-32730,-32731,-32732,-32733,-32735,-32736,-32737,-32738,-32739,-32740,-32741,-32742,-32743,-32744,-32745,-32746,-32747,-32747,-32748,-32749,-32750,-32751,-32752,-32752,-32753,-32754,-32755,-32755,-32756,-32757,-32757,-32758,-32758,-32759,-32759,-32760,-32760,-32761,-32761,-32762,-32762,-32763,-32763,-32764,-32764,-32764,-32765,-32765,-32765,-32765,-32766,-32766,-32766,-32766,-32766,-32767,-32767,-32767,-32767,-32767,-32767,-32767,
// -32767,-32767,-32767,-32767,-32767,-32767,-32767,-32767,-32766,-32766,-32766,-32766,-32766,-32765,-32765,-32765,-32765,-32764,-32764,-32764,-32763,-32763,-32762,-32762,-32761,-32761,-32760,-32760,-32759,-32759,-32758,-32758,-32757,-32757,-32756,-32755,-32755,-32754,-32753,-32752,-32752,-32751,-32750,-32749,-32748,-32747,-32747,-32746,-32745,-32744,-32743,-32742,-32741,-32740,-32739,-32738,-32737,-32736,-32735,-32733,-32732,-32731,-32730,-32729,-32728,-32726,-32725,-32724,-32722,-32721,-32720,-32718,-32717,-32716,-32714,-32713,-32711,-32710,-32708,-32707,-32705,-32704,-32702,-32701,-32699,-32697,-32696,-32694,-32692,-32691,-32689,-32687,-32685,-32684,-32682,-32680,-32678,-32676,-32674,-32673,-32671,-32669,-32667,-32665,-32663,-32661,-32659,-32657,-32655,-32653,-32650,-32648,-32646,-32644,-32642,-32640,-32637,-32635,-32633,-32631,-32628,-32626,-32624,-32621,-32619,-32617,-32614,-32612,-32609,-32607,-32604,-32602,-32599,-32597,-32594,-32592,-32589,-32586,-32584,-32581,-32578,-32576,-32573,-32570,-32567,-32565,-32562,-32559,-32556,-32553,-32550,-32547,-32545,-32542,-32539,-32536,-32533,-32530,-32527,-32524,-32521,-32517,-32514,-32511,-32508,-32505,-32502,-32499,-32495,-32492,-32489,-32486,-32482,-32479,-32476,-32472,-32469,-32466,-32462,-32459,-32455,-32452,-32448,-32445,-32441,-32438,-32434,-32431,-32427,-32423,-32420,-32416,-32412,-32409,-32405,-32401,-32397,-32394,-32390,-32386,-32382,-32378,-32375,-32371,-32367,-32363,-32359,-32355,-32351,-32347,-32343,-32339,-32335,-32331,-32327,-32322,-32318,-32314,-32310,-32306,-32302,-32297,-32293,-32289,-32285,-32280,-32276,-32272,-32267,-32263,-32258,-32254,-32250,-32245,-32241,-32236,-32232,-32227,-32223,-32218,-32213,-32209,-32204,-32200,-32195,-32190,-32185,-32181,-32176,-32171,-32166,-32162,-32157,-32152,-32147,-32142,-32137,-32132,-32128,-32123,-32118,-32113,-32108,-32103,-32098,-32092,-32087,-32082,-32077,-32072,-32067,-32062,-32057,-32051,-32046,-32041,-32036,-32030,-32025,-32020,-32014,-32009,-32004,-31998,-31993,-31987,-31982,-31976,-31971,-31965,-31960,-31954,-31949,-31943,-31937,-31932,-31926,-31921,-31915,-31909,-31903,-31898,-31892,-31886,-31880,-31875,-31869,-31863,-31857,-31851,-31845,-31839,-31833,-31827,-31821,-31815,-31809,-31803,-31797,-31791,-31785,-31779,-31773,-31767,-31760,-31754,-31748,-31742,-31736,-31729,-31723,-31717,-31710,-31704,-31698,-31691,-31685,-31679,-31672,-31666,-31659,-31653,-31646,-31640,-31633,-31627,-31620,-31613,-31607,-31600,-31593,-31587,-31580,-31573,-31567,-31560,-31553,-31546,-31539,-31533,-31526,-31519,-31512,-31505,-31498,-31491,-31484,-31477,-31470,-31463,-31456,-31449,-31442,-31435,-31428,-31421,-31414,-31407,-31400,-31392,-31385,-31378,-31371,-31363,-31356,-31349,-31341,-31334,-31327,-31319,-31312,-31305,-31297,-31290,-31282,-31275,-31267,-31260,-31252,-31245,-31237,-31229,-31222,-31214,-31206,-31199,-31191,-31183,-31176,-31168,-31160,-31152,-31145,-31137,-31129,-31121,-31113,-31105,-31097,-31089,-31082,-31074,-31066,-31058,-31050,-31041,-31033,-31025,-31017,-31009,-31001,-30993,-30985,-30977,-30968,-30960,-30952,-30944,-30935,-30927,-30919,-30910,-30902,-30894,-30885,-30877,-30868,-30860,-30852,-30843,-30835,-30826,-30818,-30809,-30800,-30792,-30783,-30775,-30766,-30757,-30749,-30740,-30731,-30723,-30714,-30705,-30696,-30687,-30679,-30670,-30661,-30652,-30643,-30634,-30625,-30616,-30607,-30598,-30589,-30580,-30571,-30562,-30553,-30544,-30535,-30526,-30517,-30508,-30498,-30489,-30480,-30471,-30462,-30452,-30443,-30434,-30424,-30415,-30406,-30396,-30387,-30377,-30368,-30359,-30349,-30340,-30330,-30321,-30311,-30302,-30292,-30282,-30273,-30263,-30253,-30244,-30234,-30224,-30215,-30205,-30195,-30185,-30176,-30166,-30156,-30146,-30136,-30126,-30117,-30107,-30097,-30087,-30077,-30067,-30057,-30047,-30037,-30027,-30017,-30007,-29997,-29986,-29976,-29966,-29956,-29946,-29936,-29925,-29915,-29905,-29894,-29884,-29874,-29864,-29853,-29843,-29832,-29822,-29812,-29801,-29791,-29780,-29770,-29759,-29749,-29738,-29728,-29717,-29706,-29696,-29685,-29675,-29664,-29653,-29642,-29632,-29621,-29610,-29599,-29589,-29578,-29567,-29556,-29545,-29534,-29524,-29513,-29502,-29491,-29480,-29469,-29458,-29447,-29436,-29425,-29414,-29403,-29392,-29380,-29369,-29358,-29347,-29336,-29325,-29313,-29302,-29291,-29280,-29268,-29257,-29246,-29234,-29223,-29212,-29200,-29189,-29177,-29166,-29154,-29143,-29131,-29120,-29108,-29097,-29085,-29074,-29062,-29050,-29039,-29027,-29016,-29004,-28992,-28980,-28969,-28957,-28945,-28933,-28922,-28910,-28898,-28886,-28874,-28862,-28850,-28838,-28827,-28815,-28803,-28791,-28779,-28767,-28755,-28742,-28730,-28718,-28706,-28694,-28682,-28670,-28658,-28645,-28633,-28621,-28609,-28596,-28584,-28572,-28560,-28547,-28535,-28523,-28510,-28498,-28485,-28473,-28460,-28448,-28436,-28423,-28411,-28398,-28385,-28373,-28360,-28348,-28335,-28322,-28310,-28297,-28284,-28272,-28259,-28246,-28234,-28221,-28208,-28195,-28182,-28170,-28157,-28144,-28131,-28118,-28105,-28092,-28079,-28066,-28053,-28040,-28027,-28014,-28001,-27988,-27975,-27962,-27949,-27936,-27923,-27910,-27896,-27883,-27870,-27857,-27843,-27830,-27817,-27804,-27790,-27777,-27764,-27750,-27737,-27724,-27710,-27697,-27683,-27670,-27656,-27643,-27629,-27616,-27602,-27589,-27575,-27562,-27548,-27534,-27521,-27507,-27493,-27480,-27466,-27452,-27439,-27425,-27411,-27397,-27384,-27370,-27356,-27342,-27328,-27314,-27300,-27287,-27273,-27259,-27245,-27231,-27217,-27203,-27189,-27175,-27161,-27147,-27133,-27118,-27104,-27090,-27076,-27062,-27048,-27034,-27019,-27005,-26991,-26977,-26962,-26948,-26934,-26919,-26905,-26891,-26876,-26862,-26848,-26833,-26819,-26804,-26790,-26775,-26761,-26746,-26732,-26717,-26703,-26688,-26674,-26659,-26644,-26630,-26615,-26600,-26586,-26571,-26556,-26542,-26527,-26512,-26497,-26482,-26468,-26453,-26438,-26423,-26408,-26393,-26378,-26364,-26349,-26334,-26319,-26304,-26289,-26274,-26259,-26244,-26229,-26214,-26198,-26183,-26168,-26153,-26138,-26123,-26108,-26092,-26077,-26062,-26047,-26031,-26016,-26001,-25986,-25970,-25955,-25940,-25924,-25909,-25893,-25878,-25863,-25847,-25832,-25816,-25801,-25785,-25770,-25754,-25739,-25723,-25708,-25692,-25676,-25661,-25645,-25629,-25614,-25598,-25582,-25567,-25551,-25535,-25519,-25504,-25488,-25472,-25456,-25440,-25425,-25409,-25393,-25377,-25361,-25345,-25329,-25313,-25297,-25281,-25265,-25249,-25233,-25217,-25201,-25185,-25169,-25153,-25137,-25121,-25105,-25088,-25072,-25056,-25040,-25024,-25007,-24991,-24975,-24959,-24942,-24926,-24910,-24893,-24877,-24861,-24844,-24828,-24811,-24795,-24779,-24762,-24746,-24729,-24713,-24696,-24680,-24663,-24647,-24630,-24613,-24597,-24580,-24564,-24547,-24530,-24514,-24497,-24480,-24464,-24447,-24430,-24413,-24397,-24380,-24363,-24346,-24329,-24312,-24296,-24279,-24262,-24245,-24228,-24211,-24194,-24177,-24160,-24143,-24126,-24109,-24092,-24075,-24058,-24041,-24024,-24007,-23990,-23973,-23956,-23938,-23921,-23904,-23887,-23870,-23852,-23835,-23818,-23801,-23783,-23766,-23749,-23731,-23714,-23697,-23679,-23662,-23645,-23627,-23610,-23592,-23575,-23557,-23540,-23522,-23505,-23487,-23470,-23452,-23435,-23417,-23400,-23382,-23364,-23347,-23329,-23311,-23294,-23276,-23258,-23241,-23223,-23205,-23188,-23170,-23152,-23134,-23116,-23099,-23081,-23063,-23045,-23027,-23009,-22991,-22973,-22956,-22938,-22920,-22902,-22884,-22866,-22848,-22830,-22812,-22794,-22776,-22757,-22739,-22721,-22703,-22685,-22667,-22649,-22631,-22612,-22594,-22576,-22558,-22540,-22521,-22503,-22485,-22466,-22448,-22430,-22411,-22393,-22375,-22356,-22338,-22320,-22301,-22283,-22264,-22246,-22227,-22209,-22191,-22172,-22154,-22135,-22116,-22098,-22079,-22061,-22042,-22024,-22005,-21986,-21968,-21949,-21930,-21912,-21893,-21874,-21856,-21837,-21818,-21799,-21781,-21762,-21743,-21724,-21705,-21687,-21668,-21649,-21630,-21611,-21592,-21573,-21554,-21535,-21516,-21498,-21479,-21460,-21441,-21422,-21403,-21383,-21364,-21345,-21326,-21307,-21288,-21269,-21250,-21231,-21212,-21192,-21173,-21154,-21135,-21116,-21096,-21077,-21058,-21039,-21019,-21000,-20981,-20962,-20942,-20923,-20904,-20884,-20865,-20845,-20826,-20807,-20787,-20768,-20748,-20729,-20709,-20690,-20670,-20651,-20631,-20612,-20592,-20573,-20553,-20534,-20514,-20494,-20475,-20455,-20436,-20416,-20396,-20377,-20357,-20337,-20317,-20298,-20278,-20258,-20238,-20219,-20199,-20179,-20159,-20139,-20120,-20100,-20080,-20060,-20040,-20020,-20000,-19981,-19961,-19941,-19921,-19901,-19881,-19861,-19841,-19821,-19801,-19781,-19761,-19741,-19721,-19700,-19680,-19660,-19640,-19620,-19600,-19580,-19560,-19539,-19519,-19499,-19479,-19459,-19438,-19418,-19398,-19378,-19357,-19337,-19317,-19297,-19276,-19256,-19236,-19215,-19195,-19174,-19154,-19134,-19113,-19093,-19072,-19052,-19032,-19011,-18991,-18970,-18950,-18929,-18909,-18888,-18868,-18847,-18826,-18806,-18785,-18765,-18744,-18723,-18703,-18682,-18661,-18641,-18620,-18599,-18579,-18558,-18537,-18517,-18496,-18475,-18454,-18434,-18413,-18392,-18371,-18350,-18330,-18309,-18288,-18267,-18246,-18225,-18204,-18183,-18163,-18142,-18121,-18100,-18079,-18058,-18037,-18016,-17995,-17974,-17953,-17932,-17911,-17890,-17869,-17848,-17827,-17805,-17784,-17763,-17742,-17721,-17700,-17679,-17657,-17636,-17615,-17594,-17573,-17551,-17530,-17509,-17488,-17467,-17445,-17424,-17403,-17381,-17360,-17339,-17317,-17296,-17275,-17253,-17232,-17211,-17189,-17168,-17146,-17125,-17104,-17082,-17061,-17039,-17018,-16996,-16975,-16953,-16932,-16910,-16889,-16867,-16846,-16824,-16802,-16781,-16759,-16738,-16716,-16694,-16673,-16651,-16630,-16608,-16586,-16565,-16543,-16521,-16499,-16478,-16456,-16434,-16413,-16391,-16369,-16347,-16325,-16304,-16282,-16260,-16238,-16216,-16195,-16173,-16151,-16129,-16107,-16085,-16063,-16041,-16019,-15997,-15976,-15954,-15932,-15910,-15888,-15866,-15844,-15822,-15800,-15778,-15756,-15734,-15712,-15690,-15667,-15645,-15623,-15601,-15579,-15557,-15535,-15513,-15491,-15468,-15446,-15424,-15402,-15380,-15358,-15335,-15313,-15291,-15269,-15246,-15224,-15202,-15180,-15157,-15135,-15113,-15090,-15068,-15046,-15024,-15001,-14979,-14956,-14934,-14912,-14889,-14867,-14845,-14822,-14800,-14777,-14755,-14732,-14710,-14688,-14665,-14643,-14620,-14598,-14575,-14553,-14530,-14507,-14485,-14462,-14440,-14417,-14395,-14372,-14350,-14327,-14304,-14282,-14259,-14236,-14214,-14191,-14169,-14146,-14123,-14101,-14078,-14055,-14032,-14010,-13987,-13964,-13942,-13919,-13896,-13873,-13850,-13828,-13805,-13782,-13759,-13736,-13714,-13691,-13668,-13645,-13622,-13599,-13577,-13554,-13531,-13508,-13485,-13462,-13439,-13416,-13393,-13370,-13347,-13324,-13302,-13279,-13256,-13233,-13210,-13187,-13164,-13141,-13118,-13094,-13071,-13048,-13025,-13002,-12979,-12956,-12933,-12910,-12887,-12864,-12841,-12817,-12794,-12771,-12748,-12725,-12702,-12679,-12655,-12632,-12609,-12586,-12563,-12539,-12516,-12493,-12470,-12446,-12423,-12400,-12377,-12353,-12330,-12307,-12284,-12260,-12237,-12214,-12190,-12167,-12144,-12120,-12097,-12074,-12050,-12027,-12003,-11980,-11957,-11933,-11910,-11886,-11863,-11840,-11816,-11793,-11769,-11746,-11722,-11699,-11675,-11652,-11628,-11605,-11581,-11558,-11534,-11511,-11487,-11464,-11440,-11417,-11393,-11370,-11346,-11322,-11299,-11275,-11252,-11228,-11204,-11181,-11157,-11133,-11110,-11086,-11063,-11039,-11015,-10992,-10968,-10944,-10920,-10897,-10873,-10849,-10826,-10802,-10778,-10754,-10731,-10707,-10683,-10659,-10636,-10612,-10588,-10564,-10541,-10517,-10493,-10469,-10445,-10421,-10398,-10374,-10350,-10326,-10302,-10278,-10255,-10231,-10207,-10183,-10159,-10135,-10111,-10087,-10063,-10039,-10016,-9992,-9968,-9944,-9920,-9896,-9872,-9848,-9824,-9800,-9776,-9752,-9728,-9704,-9680,-9656,-9632,-9608,-9584,-9560,-9536,-9512,-9488,-9464,-9440,-9416,-9391,-9367,-9343,-9319,-9295,-9271,-9247,-9223,-9199,-9175,-9150,-9126,-9102,-9078,-9054,-9030,-9006,-8981,-8957,-8933,-8909,-8885,-8860,-8836,-8812,-8788,-8764,-8739,-8715,-8691,-8667,-8642,-8618,-8594,-8570,-8545,-8521,-8497,-8473,-8448,-8424,-8400,-8375,-8351,-8327,-8303,-8278,-8254,-8230,-8205,-8181,-8157,-8132,-8108,-8084,-8059,-8035,-8010,-7986,-7962,-7937,-7913,-7889,-7864,-7840,-7815,-7791,-7767,-7742,-7718,-7693,-7669,-7644,-7620,-7596,-7571,-7547,-7522,-7498,-7473,-7449,-7424,-7400,-7375,-7351,-7326,-7302,-7277,-7253,-7228,-7204,-7179,-7155,-7130,-7106,-7081,-7057,-7032,-7008,-6983,-6958,-6934,-6909,-6885,-6860,-6836,-6811,-6786,-6762,-6737,-6713,-6688,-6663,-6639,-6614,-6590,-6565,-6540,-6516,-6491,-6466,-6442,-6417,-6393,-6368,-6343,-6319,-6294,-6269,-6245,-6220,-6195,-6171,-6146,-6121,-6096,-6072,-6047,-6022,-5998,-5973,-5948,-5924,-5899,-5874,-5849,-5825,-5800,-5775,-5750,-5726,-5701,-5676,-5651,-5627,-5602,-5577,-5552,-5528,-5503,-5478,-5453,-5428,-5404,-5379,-5354,-5329,-5305,-5280,-5255,-5230,-5205,-5180,-5156,-5131,-5106,-5081,-5056,-5032,-5007,-4982,-4957,-4932,-4907,-4882,-4858,-4833,-4808,-4783,-4758,-4733,-4708,-4684,-4659,-4634,-4609,-4584,-4559,-4534,-4509,-4485,-4460,-4435,-4410,-4385,-4360,-4335,-4310,-4285,-4260,-4235,-4210,-4186,-4161,-4136,-4111,-4086,-4061,-4036,-4011,-3986,-3961,-3936,-3911,-3886,-3861,-3836,-3811,-3786,-3761,-3737,-3712,-3687,-3662,-3637,-3612,-3587,-3562,-3537,-3512,-3487,-3462,-3437,-3412,-3387,-3362,-3337,-3312,-3287,-3262,-3237,-3212,-3187,-3162,-3137,-3112,-3087,-3062,-3037,-3012,-2987,-2962,-2936,-2911,-2886,-2861,-2836,-2811,-2786,-2761,-2736,-2711,-2686,-2661,-2636,-2611,-2586,-2561,-2536,-2511,-2486,-2461,-2436,-2410,-2385,-2360,-2335,-2310,-2285,-2260,-2235,-2210,-2185,-2160,-2135,-2110,-2085,-2059,-2034,-2009,-1984,-1959,-1934,-1909,-1884,-1859,-1834,-1809,-1783,-1758,-1733,-1708,-1683,-1658,-1633,-1608,-1583,-1558,-1532,-1507,-1482,-1457,-1432,-1407,-1382,-1357,-1332,-1307,-1281,-1256,-1231,-1206,-1181,-1156,-1131,-1106,-1080,-1055,-1030,-1005,-980,-955,-930,-905,-880,-854,-829,-804,-779,-754,-729,-704,-679,-653,-628,-603,-578,-553,-528,-503,-477,-452,-427,-402,-377,-352,-327,-302,-276,-251,-226,-201,-176,-151,-126,-101,-75,-50,-25,
// };

/* X: 4096 */
const int16 bm_sin_table[] = {
0,50,101,151,201,251,302,352,402,452,503,553,603,653,704,754,804,854,905,955,1005,1055,1106,1156,1206,1256,1307,1357,1407,1457,1507,1558,1608,1658,1708,1758,1809,1859,1909,1959,2009,2059,2110,2160,2210,2260,2310,2360,2410,2461,2511,2561,2611,2661,2711,2761,2811,2861,2911,2962,3012,3062,3112,3162,3212,3262,3312,3362,3412,3462,3512,3562,3612,3662,3712,3761,3811,3861,3911,3961,4011,4061,4111,4161,4210,4260,4310,4360,4410,4460,4509,4559,4609,4659,4708,4758,4808,4858,4907,4957,5007,5056,5106,5156,5205,5255,5305,5354,5404,5453,5503,5552,5602,5651,5701,5750,5800,5849,5899,5948,5998,6047,6096,6146,6195,6245,6294,6343,6393,6442,6491,6540,6590,6639,6688,6737,6786,6836,6885,6934,6983,7032,7081,7130,7179,7228,7277,7326,7375,7424,7473,7522,7571,7620,7669,7718,7767,7815,7864,7913,7962,8010,8059,8108,8157,8205,8254,8303,8351,8400,8448,8497,8545,8594,8642,8691,8739,8788,8836,8885,8933,8981,9030,9078,9126,9175,9223,9271,9319,9367,9416,9464,9512,9560,9608,9656,9704,9752,9800,9848,9896,9944,9992,10039,10087,10135,10183,10231,10278,10326,10374,10421,10469,10517,10564,10612,10659,10707,10754,10802,10849,10897,10944,10992,11039,11086,11133,11181,11228,11275,11322,11370,11417,11464,11511,11558,11605,11652,11699,11746,11793,11840,11886,11933,11980,12027,12074,12120,12167,12214,12260,12307,12353,12400,12446,12493,12539,12586,12632,12679,12725,12771,12817,12864,12910,12956,13002,13048,13094,13141,13187,13233,13279,13324,13370,13416,13462,13508,13554,13599,13645,13691,13736,13782,13828,13873,13919,13964,14010,14055,14101,14146,14191,14236,14282,14327,14372,14417,14462,14507,14553,14598,14643,14688,14732,14777,14822,14867,14912,14956,15001,15046,15090,15135,15180,15224,15269,15313,15358,15402,15446,15491,15535,15579,15623,15667,15712,15756,15800,15844,15888,15932,15976,16019,16063,16107,16151,16195,16238,16282,16325,16369,16413,16456,16499,16543,16586,16630,16673,16716,16759,16802,16846,16889,16932,16975,17018,17061,17104,17146,17189,17232,17275,17317,17360,17403,17445,17488,17530,17573,17615,17657,17700,17742,17784,17827,17869,17911,17953,17995,18037,18079,18121,18163,18204,18246,18288,18330,18371,18413,18454,18496,18537,18579,18620,18661,18703,18744,18785,18826,18868,18909,18950,18991,19032,19072,19113,19154,19195,19236,19276,19317,19357,19398,19438,19479,19519,19560,19600,19640,19680,19721,19761,19801,19841,19881,19921,19961,20000,20040,20080,20120,20159,20199,20238,20278,20317,20357,20396,20436,20475,20514,20553,20592,20631,20670,20709,20748,20787,20826,20865,20904,20942,20981,21019,21058,21096,21135,21173,21212,21250,21288,21326,21364,21403,21441,21479,21516,21554,21592,21630,21668,21705,21743,21781,21818,21856,21893,21930,21968,22005,22042,22079,22116,22154,22191,22227,22264,22301,22338,22375,22411,22448,22485,22521,22558,22594,22631,22667,22703,22739,22776,22812,22848,22884,22920,22956,22991,23027,23063,23099,23134,23170,23205,23241,23276,23311,23347,23382,23417,23452,23487,23522,23557,23592,23627,23662,23697,23731,23766,23801,23835,23870,23904,23938,23973,24007,24041,24075,24109,24143,24177,24211,24245,24279,24312,24346,24380,24413,24447,24480,24514,24547,24580,24613,24647,24680,24713,24746,24779,24811,24844,24877,24910,24942,24975,25007,25040,25072,25105,25137,25169,25201,25233,25265,25297,25329,25361,25393,25425,25456,25488,25519,25551,25582,25614,25645,25676,25708,25739,25770,25801,25832,25863,25893,25924,25955,25986,26016,26047,26077,26108,26138,26168,26198,26229,26259,26289,26319,26349,26378,26408,26438,26468,26497,26527,26556,26586,26615,26644,26674,26703,26732,26761,26790,26819,26848,26876,26905,26934,26962,26991,27019,27048,27076,27104,27133,27161,27189,27217,27245,27273,27300,27328,27356,27384,27411,27439,27466,27493,27521,27548,27575,27602,27629,27656,27683,27710,27737,27764,27790,27817,27843,27870,27896,27923,27949,27975,28001,28027,28053,28079,28105,28131,28157,28182,28208,28234,28259,28284,28310,28335,28360,28385,28411,28436,28460,28485,28510,28535,28560,28584,28609,28633,28658,28682,28706,28730,28755,28779,28803,28827,28850,28874,28898,28922,28945,28969,28992,29016,29039,29062,29085,29108,29131,29154,29177,29200,29223,29246,29268,29291,29313,29336,29358,29380,29403,29425,29447,29469,29491,29513,29534,29556,29578,29599,29621,29642,29664,29685,29706,29728,29749,29770,29791,29812,29832,29853,29874,29894,29915,29936,29956,29976,29997,30017,30037,30057,30077,30097,30117,30136,30156,30176,30195,30215,30234,30253,30273,30292,30311,30330,30349,30368,30387,30406,30424,30443,30462,30480,30498,30517,30535,30553,30571,30589,30607,30625,30643,30661,30679,30696,30714,30731,30749,30766,30783,30800,30818,30835,30852,30868,30885,30902,30919,30935,30952,30968,30985,31001,31017,31033,31050,31066,31082,31097,31113,31129,31145,31160,31176,31191,31206,31222,31237,31252,31267,31282,31297,31312,31327,31341,31356,31371,31385,31400,31414,31428,31442,31456,31470,31484,31498,31512,31526,31539,31553,31567,31580,31593,31607,31620,31633,31646,31659,31672,31685,31698,31710,31723,31736,31748,31760,31773,31785,31797,31809,31821,31833,31845,31857,31869,31880,31892,31903,31915,31926,31937,31949,31960,31971,31982,31993,32004,32014,32025,32036,32046,32057,32067,32077,32087,32098,32108,32118,32128,32137,32147,32157,32166,32176,32185,32195,32204,32213,32223,32232,32241,32250,32258,32267,32276,32285,32293,32302,32310,32318,32327,32335,32343,32351,32359,32367,32375,32382,32390,32397,32405,32412,32420,32427,32434,32441,32448,32455,32462,32469,32476,32482,32489,32495,32502,32508,32514,32521,32527,32533,32539,32545,32550,32556,32562,32567,32573,32578,32584,32589,32594,32599,32604,32609,32614,32619,32624,32628,32633,32637,32642,32646,32650,32655,32659,32663,32667,32671,32674,32678,32682,32685,32689,32692,32696,32699,32702,32705,32708,32711,32714,32717,32720,32722,32725,32728,32730,32732,32735,32737,32739,32741,32743,32745,32747,32748,32750,32752,32753,32755,32756,32757,32758,32759,32760,32761,32762,32763,32764,32765,32765,32766,32766,32766,32767,32767,32767,32767,32767,32767,32767,32766,32766,32766,32765,32765,32764,32763,32762,32761,32760,32759,32758,32757,32756,32755,32753,32752,32750,32748,32747,32745,32743,32741,32739,32737,32735,32732,32730,32728,32725,32722,32720,32717,32714,32711,32708,32705,32702,32699,32696,32692,32689,32685,32682,32678,32674,32671,32667,32663,32659,32655,32650,32646,32642,32637,32633,32628,32624,32619,32614,32609,32604,32599,32594,32589,32584,32578,32573,32567,32562,32556,32550,32545,32539,32533,32527,32521,32514,32508,32502,32495,32489,32482,32476,32469,32462,32455,32448,32441,32434,32427,32420,32412,32405,32397,32390,32382,32375,32367,32359,32351,32343,32335,32327,32318,32310,32302,32293,32285,32276,32267,32258,32250,32241,32232,32223,32213,32204,32195,32185,32176,32166,32157,32147,32137,32128,32118,32108,32098,32087,32077,32067,32057,32046,32036,32025,32014,32004,31993,31982,31971,31960,31949,31937,31926,31915,31903,31892,31880,31869,31857,31845,31833,31821,31809,31797,31785,31773,31760,31748,31736,31723,31710,31698,31685,31672,31659,31646,31633,31620,31607,31593,31580,31567,31553,31539,31526,31512,31498,31484,31470,31456,31442,31428,31414,31400,31385,31371,31356,31341,31327,31312,31297,31282,31267,31252,31237,31222,31206,31191,31176,31160,31145,31129,31113,31097,31082,31066,31050,31033,31017,31001,30985,30968,30952,30935,30919,30902,30885,30868,30852,30835,30818,30800,30783,30766,30749,30731,30714,30696,30679,30661,30643,30625,30607,30589,30571,30553,30535,30517,30498,30480,30462,30443,30424,30406,30387,30368,30349,30330,30311,30292,30273,30253,30234,30215,30195,30176,30156,30136,30117,30097,30077,30057,30037,30017,29997,29976,29956,29936,29915,29894,29874,29853,29832,29812,29791,29770,29749,29728,29706,29685,29664,29642,29621,29599,29578,29556,29534,29513,29491,29469,29447,29425,29403,29380,29358,29336,29313,29291,29268,29246,29223,29200,29177,29154,29131,29108,29085,29062,29039,29016,28992,28969,28945,28922,28898,28874,28850,28827,28803,28779,28755,28730,28706,28682,28658,28633,28609,28584,28560,28535,28510,28485,28460,28436,28411,28385,28360,28335,28310,28284,28259,28234,28208,28182,28157,28131,28105,28079,28053,28027,28001,27975,27949,27923,27896,27870,27843,27817,27790,27764,27737,27710,27683,27656,27629,27602,27575,27548,27521,27493,27466,27439,27411,27384,27356,27328,27300,27273,27245,27217,27189,27161,27133,27104,27076,27048,27019,26991,26962,26934,26905,26876,26848,26819,26790,26761,26732,26703,26674,26644,26615,26586,26556,26527,26497,26468,26438,26408,26378,26349,26319,26289,26259,26229,26198,26168,26138,26108,26077,26047,26016,25986,25955,25924,25893,25863,25832,25801,25770,25739,25708,25676,25645,25614,25582,25551,25519,25488,25456,25425,25393,25361,25329,25297,25265,25233,25201,25169,25137,25105,25072,25040,25007,24975,24942,24910,24877,24844,24811,24779,24746,24713,24680,24647,24613,24580,24547,24514,24480,24447,24413,24380,24346,24312,24279,24245,24211,24177,24143,24109,24075,24041,24007,23973,23938,23904,23870,23835,23801,23766,23731,23697,23662,23627,23592,23557,23522,23487,23452,23417,23382,23347,23311,23276,23241,23205,23170,23134,23099,23063,23027,22991,22956,22920,22884,22848,22812,22776,22739,22703,22667,22631,22594,22558,22521,22485,22448,22411,22375,22338,22301,22264,22227,22191,22154,22116,22079,22042,22005,21968,21930,21893,21856,21818,21781,21743,21705,21668,21630,21592,21554,21516,21479,21441,21403,21364,21326,21288,21250,21212,21173,21135,21096,21058,21019,20981,20942,20904,20865,20826,20787,20748,20709,20670,20631,20592,20553,20514,20475,20436,20396,20357,20317,20278,20238,20199,20159,20120,20080,20040,20000,19961,19921,19881,19841,19801,19761,19721,19680,19640,19600,19560,19519,19479,19438,19398,19357,19317,19276,19236,19195,19154,19113,19072,19032,18991,18950,18909,18868,18826,18785,18744,18703,18661,18620,18579,18537,18496,18454,18413,18371,18330,18288,18246,18204,18163,18121,18079,18037,17995,17953,17911,17869,17827,17784,17742,17700,17657,17615,17573,17530,17488,17445,17403,17360,17317,17275,17232,17189,17146,17104,17061,17018,16975,16932,16889,16846,16802,16759,16716,16673,16630,16586,16543,16499,16456,16413,16369,16325,16282,16238,16195,16151,16107,16063,16019,15976,15932,15888,15844,15800,15756,15712,15667,15623,15579,15535,15491,15446,15402,15358,15313,15269,15224,15180,15135,15090,15046,15001,14956,14912,14867,14822,14777,14732,14688,14643,14598,14553,14507,14462,14417,14372,14327,14282,14236,14191,14146,14101,14055,14010,13964,13919,13873,13828,13782,13736,13691,13645,13599,13554,13508,13462,13416,13370,13324,13279,13233,13187,13141,13094,13048,13002,12956,12910,12864,12817,12771,12725,12679,12632,12586,12539,12493,12446,12400,12353,12307,12260,12214,12167,12120,12074,12027,11980,11933,11886,11840,11793,11746,11699,11652,11605,11558,11511,11464,11417,11370,11322,11275,11228,11181,11133,11086,11039,10992,10944,10897,10849,10802,10754,10707,10659,10612,10564,10517,10469,10421,10374,10326,10278,10231,10183,10135,10087,10039,9992,9944,9896,9848,9800,9752,9704,9656,9608,9560,9512,9464,9416,9367,9319,9271,9223,9175,9126,9078,9030,8981,8933,8885,8836,8788,8739,8691,8642,8594,8545,8497,8448,8400,8351,8303,8254,8205,8157,8108,8059,8010,7962,7913,7864,7815,7767,7718,7669,7620,7571,7522,7473,7424,7375,7326,7277,7228,7179,7130,7081,7032,6983,6934,6885,6836,6786,6737,6688,6639,6590,6540,6491,6442,6393,6343,6294,6245,6195,6146,6096,6047,5998,5948,5899,5849,5800,5750,5701,5651,5602,5552,5503,5453,5404,5354,5305,5255,5205,5156,5106,5056,5007,4957,4907,4858,4808,4758,4708,4659,4609,4559,4509,4460,4410,4360,4310,4260,4210,4161,4111,4061,4011,3961,3911,3861,3811,3761,3712,3662,3612,3562,3512,3462,3412,3362,3312,3262,3212,3162,3112,3062,3012,2962,2911,2861,2811,2761,2711,2661,2611,2561,2511,2461,2410,2360,2310,2260,2210,2160,2110,2059,2009,1959,1909,1859,1809,1758,1708,1658,1608,1558,1507,1457,1407,1357,1307,1256,1206,1156,1106,1055,1005,955,905,854,804,754,704,653,603,553,503,452,402,352,302,251,201,151,101,50,
0,-50,-101,-151,-201,-251,-302,-352,-402,-452,-503,-553,-603,-653,-704,-754,-804,-854,-905,-955,-1005,-1055,-1106,-1156,-1206,-1256,-1307,-1357,-1407,-1457,-1507,-1558,-1608,-1658,-1708,-1758,-1809,-1859,-1909,-1959,-2009,-2059,-2110,-2160,-2210,-2260,-2310,-2360,-2410,-2461,-2511,-2561,-2611,-2661,-2711,-2761,-2811,-2861,-2911,-2962,-3012,-3062,-3112,-3162,-3212,-3262,-3312,-3362,-3412,-3462,-3512,-3562,-3612,-3662,-3712,-3761,-3811,-3861,-3911,-3961,-4011,-4061,-4111,-4161,-4210,-4260,-4310,-4360,-4410,-4460,-4509,-4559,-4609,-4659,-4708,-4758,-4808,-4858,-4907,-4957,-5007,-5056,-5106,-5156,-5205,-5255,-5305,-5354,-5404,-5453,-5503,-5552,-5602,-5651,-5701,-5750,-5800,-5849,-5899,-5948,-5998,-6047,-6096,-6146,-6195,-6245,-6294,-6343,-6393,-6442,-6491,-6540,-6590,-6639,-6688,-6737,-6786,-6836,-6885,-6934,-6983,-7032,-7081,-7130,-7179,-7228,-7277,-7326,-7375,-7424,-7473,-7522,-7571,-7620,-7669,-7718,-7767,-7815,-7864,-7913,-7962,-8010,-8059,-8108,-8157,-8205,-8254,-8303,-8351,-8400,-8448,-8497,-8545,-8594,-8642,-8691,-8739,-8788,-8836,-8885,-8933,-8981,-9030,-9078,-9126,-9175,-9223,-9271,-9319,-9367,-9416,-9464,-9512,-9560,-9608,-9656,-9704,-9752,-9800,-9848,-9896,-9944,-9992,-10039,-10087,-10135,-10183,-10231,-10278,-10326,-10374,-10421,-10469,-10517,-10564,-10612,-10659,-10707,-10754,-10802,-10849,-10897,-10944,-10992,-11039,-11086,-11133,-11181,-11228,-11275,-11322,-11370,-11417,-11464,-11511,-11558,-11605,-11652,-11699,-11746,-11793,-11840,-11886,-11933,-11980,-12027,-12074,-12120,-12167,-12214,-12260,-12307,-12353,-12400,-12446,-12493,-12539,-12586,-12632,-12679,-12725,-12771,-12817,-12864,-12910,-12956,-13002,-13048,-13094,-13141,-13187,-13233,-13279,-13324,-13370,-13416,-13462,-13508,-13554,-13599,-13645,-13691,-13736,-13782,-13828,-13873,-13919,-13964,-14010,-14055,-14101,-14146,-14191,-14236,-14282,-14327,-14372,-14417,-14462,-14507,-14553,-14598,-14643,-14688,-14732,-14777,-14822,-14867,-14912,-14956,-15001,-15046,-15090,-15135,-15180,-15224,-15269,-15313,-15358,-15402,-15446,-15491,-15535,-15579,-15623,-15667,-15712,-15756,-15800,-15844,-15888,-15932,-15976,-16019,-16063,-16107,-16151,-16195,-16238,-16282,-16325,-16369,-16413,-16456,-16499,-16543,-16586,-16630,-16673,-16716,-16759,-16802,-16846,-16889,-16932,-16975,-17018,-17061,-17104,-17146,-17189,-17232,-17275,-17317,-17360,-17403,-17445,-17488,-17530,-17573,-17615,-17657,-17700,-17742,-17784,-17827,-17869,-17911,-17953,-17995,-18037,-18079,-18121,-18163,-18204,-18246,-18288,-18330,-18371,-18413,-18454,-18496,-18537,-18579,-18620,-18661,-18703,-18744,-18785,-18826,-18868,-18909,-18950,-18991,-19032,-19072,-19113,-19154,-19195,-19236,-19276,-19317,-19357,-19398,-19438,-19479,-19519,-19560,-19600,-19640,-19680,-19721,-19761,-19801,-19841,-19881,-19921,-19961,-20000,-20040,-20080,-20120,-20159,-20199,-20238,-20278,-20317,-20357,-20396,-20436,-20475,-20514,-20553,-20592,-20631,-20670,-20709,-20748,-20787,-20826,-20865,-20904,-20942,-20981,-21019,-21058,-21096,-21135,-21173,-21212,-21250,-21288,-21326,-21364,-21403,-21441,-21479,-21516,-21554,-21592,-21630,-21668,-21705,-21743,-21781,-21818,-21856,-21893,-21930,-21968,-22005,-22042,-22079,-22116,-22154,-22191,-22227,-22264,-22301,-22338,-22375,-22411,-22448,-22485,-22521,-22558,-22594,-22631,-22667,-22703,-22739,-22776,-22812,-22848,-22884,-22920,-22956,-22991,-23027,-23063,-23099,-23134,-23170,-23205,-23241,-23276,-23311,-23347,-23382,-23417,-23452,-23487,-23522,-23557,-23592,-23627,-23662,-23697,-23731,-23766,-23801,-23835,-23870,-23904,-23938,-23973,-24007,-24041,-24075,-24109,-24143,-24177,-24211,-24245,-24279,-24312,-24346,-24380,-24413,-24447,-24480,-24514,-24547,-24580,-24613,-24647,-24680,-24713,-24746,-24779,-24811,-24844,-24877,-24910,-24942,-24975,-25007,-25040,-25072,-25105,-25137,-25169,-25201,-25233,-25265,-25297,-25329,-25361,-25393,-25425,-25456,-25488,-25519,-25551,-25582,-25614,-25645,-25676,-25708,-25739,-25770,-25801,-25832,-25863,-25893,-25924,-25955,-25986,-26016,-26047,-26077,-26108,-26138,-26168,-26198,-26229,-26259,-26289,-26319,-26349,-26378,-26408,-26438,-26468,-26497,-26527,-26556,-26586,-26615,-26644,-26674,-26703,-26732,-26761,-26790,-26819,-26848,-26876,-26905,-26934,-26962,-26991,-27019,-27048,-27076,-27104,-27133,-27161,-27189,-27217,-27245,-27273,-27300,-27328,-27356,-27384,-27411,-27439,-27466,-27493,-27521,-27548,-27575,-27602,-27629,-27656,-27683,-27710,-27737,-27764,-27790,-27817,-27843,-27870,-27896,-27923,-27949,-27975,-28001,-28027,-28053,-28079,-28105,-28131,-28157,-28182,-28208,-28234,-28259,-28284,-28310,-28335,-28360,-28385,-28411,-28436,-28460,-28485,-28510,-28535,-28560,-28584,-28609,-28633,-28658,-28682,-28706,-28730,-28755,-28779,-28803,-28827,-28850,-28874,-28898,-28922,-28945,-28969,-28992,-29016,-29039,-29062,-29085,-29108,-29131,-29154,-29177,-29200,-29223,-29246,-29268,-29291,-29313,-29336,-29358,-29380,-29403,-29425,-29447,-29469,-29491,-29513,-29534,-29556,-29578,-29599,-29621,-29642,-29664,-29685,-29706,-29728,-29749,-29770,-29791,-29812,-29832,-29853,-29874,-29894,-29915,-29936,-29956,-29976,-29997,-30017,-30037,-30057,-30077,-30097,-30117,-30136,-30156,-30176,-30195,-30215,-30234,-30253,-30273,-30292,-30311,-30330,-30349,-30368,-30387,-30406,-30424,-30443,-30462,-30480,-30498,-30517,-30535,-30553,-30571,-30589,-30607,-30625,-30643,-30661,-30679,-30696,-30714,-30731,-30749,-30766,-30783,-30800,-30818,-30835,-30852,-30868,-30885,-30902,-30919,-30935,-30952,-30968,-30985,-31001,-31017,-31033,-31050,-31066,-31082,-31097,-31113,-31129,-31145,-31160,-31176,-31191,-31206,-31222,-31237,-31252,-31267,-31282,-31297,-31312,-31327,-31341,-31356,-31371,-31385,-31400,-31414,-31428,-31442,-31456,-31470,-31484,-31498,-31512,-31526,-31539,-31553,-31567,-31580,-31593,-31607,-31620,-31633,-31646,-31659,-31672,-31685,-31698,-31710,-31723,-31736,-31748,-31760,-31773,-31785,-31797,-31809,-31821,-31833,-31845,-31857,-31869,-31880,-31892,-31903,-31915,-31926,-31937,-31949,-31960,-31971,-31982,-31993,-32004,-32014,-32025,-32036,-32046,-32057,-32067,-32077,-32087,-32098,-32108,-32118,-32128,-32137,-32147,-32157,-32166,-32176,-32185,-32195,-32204,-32213,-32223,-32232,-32241,-32250,-32258,-32267,-32276,-32285,-32293,-32302,-32310,-32318,-32327,-32335,-32343,-32351,-32359,-32367,-32375,-32382,-32390,-32397,-32405,-32412,-32420,-32427,-32434,-32441,-32448,-32455,-32462,-32469,-32476,-32482,-32489,-32495,-32502,-32508,-32514,-32521,-32527,-32533,-32539,-32545,-32550,-32556,-32562,-32567,-32573,-32578,-32584,-32589,-32594,-32599,-32604,-32609,-32614,-32619,-32624,-32628,-32633,-32637,-32642,-32646,-32650,-32655,-32659,-32663,-32667,-32671,-32674,-32678,-32682,-32685,-32689,-32692,-32696,-32699,-32702,-32705,-32708,-32711,-32714,-32717,-32720,-32722,-32725,-32728,-32730,-32732,-32735,-32737,-32739,-32741,-32743,-32745,-32747,-32748,-32750,-32752,-32753,-32755,-32756,-32757,-32758,-32759,-32760,-32761,-32762,-32763,-32764,-32765,-32765,-32766,-32766,-32766,-32767,-32767,-32767,-32767,-32767,-32767,-32767,-32766,-32766,-32766,-32765,-32765,-32764,-32763,-32762,-32761,-32760,-32759,-32758,-32757,-32756,-32755,-32753,-32752,-32750,-32748,-32747,-32745,-32743,-32741,-32739,-32737,-32735,-32732,-32730,-32728,-32725,-32722,-32720,-32717,-32714,-32711,-32708,-32705,-32702,-32699,-32696,-32692,-32689,-32685,-32682,-32678,-32674,-32671,-32667,-32663,-32659,-32655,-32650,-32646,-32642,-32637,-32633,-32628,-32624,-32619,-32614,-32609,-32604,-32599,-32594,-32589,-32584,-32578,-32573,-32567,-32562,-32556,-32550,-32545,-32539,-32533,-32527,-32521,-32514,-32508,-32502,-32495,-32489,-32482,-32476,-32469,-32462,-32455,-32448,-32441,-32434,-32427,-32420,-32412,-32405,-32397,-32390,-32382,-32375,-32367,-32359,-32351,-32343,-32335,-32327,-32318,-32310,-32302,-32293,-32285,-32276,-32267,-32258,-32250,-32241,-32232,-32223,-32213,-32204,-32195,-32185,-32176,-32166,-32157,-32147,-32137,-32128,-32118,-32108,-32098,-32087,-32077,-32067,-32057,-32046,-32036,-32025,-32014,-32004,-31993,-31982,-31971,-31960,-31949,-31937,-31926,-31915,-31903,-31892,-31880,-31869,-31857,-31845,-31833,-31821,-31809,-31797,-31785,-31773,-31760,-31748,-31736,-31723,-31710,-31698,-31685,-31672,-31659,-31646,-31633,-31620,-31607,-31593,-31580,-31567,-31553,-31539,-31526,-31512,-31498,-31484,-31470,-31456,-31442,-31428,-31414,-31400,-31385,-31371,-31356,-31341,-31327,-31312,-31297,-31282,-31267,-31252,-31237,-31222,-31206,-31191,-31176,-31160,-31145,-31129,-31113,-31097,-31082,-31066,-31050,-31033,-31017,-31001,-30985,-30968,-30952,-30935,-30919,-30902,-30885,-30868,-30852,-30835,-30818,-30800,-30783,-30766,-30749,-30731,-30714,-30696,-30679,-30661,-30643,-30625,-30607,-30589,-30571,-30553,-30535,-30517,-30498,-30480,-30462,-30443,-30424,-30406,-30387,-30368,-30349,-30330,-30311,-30292,-30273,-30253,-30234,-30215,-30195,-30176,-30156,-30136,-30117,-30097,-30077,-30057,-30037,-30017,-29997,-29976,-29956,-29936,-29915,-29894,-29874,-29853,-29832,-29812,-29791,-29770,-29749,-29728,-29706,-29685,-29664,-29642,-29621,-29599,-29578,-29556,-29534,-29513,-29491,-29469,-29447,-29425,-29403,-29380,-29358,-29336,-29313,-29291,-29268,-29246,-29223,-29200,-29177,-29154,-29131,-29108,-29085,-29062,-29039,-29016,-28992,-28969,-28945,-28922,-28898,-28874,-28850,-28827,-28803,-28779,-28755,-28730,-28706,-28682,-28658,-28633,-28609,-28584,-28560,-28535,-28510,-28485,-28460,-28436,-28411,-28385,-28360,-28335,-28310,-28284,-28259,-28234,-28208,-28182,-28157,-28131,-28105,-28079,-28053,-28027,-28001,-27975,-27949,-27923,-27896,-27870,-27843,-27817,-27790,-27764,-27737,-27710,-27683,-27656,-27629,-27602,-27575,-27548,-27521,-27493,-27466,-27439,-27411,-27384,-27356,-27328,-27300,-27273,-27245,-27217,-27189,-27161,-27133,-27104,-27076,-27048,-27019,-26991,-26962,-26934,-26905,-26876,-26848,-26819,-26790,-26761,-26732,-26703,-26674,-26644,-26615,-26586,-26556,-26527,-26497,-26468,-26438,-26408,-26378,-26349,-26319,-26289,-26259,-26229,-26198,-26168,-26138,-26108,-26077,-26047,-26016,-25986,-25955,-25924,-25893,-25863,-25832,-25801,-25770,-25739,-25708,-25676,-25645,-25614,-25582,-25551,-25519,-25488,-25456,-25425,-25393,-25361,-25329,-25297,-25265,-25233,-25201,-25169,-25137,-25105,-25072,-25040,-25007,-24975,-24942,-24910,-24877,-24844,-24811,-24779,-24746,-24713,-24680,-24647,-24613,-24580,-24547,-24514,-24480,-24447,-24413,-24380,-24346,-24312,-24279,-24245,-24211,-24177,-24143,-24109,-24075,-24041,-24007,-23973,-23938,-23904,-23870,-23835,-23801,-23766,-23731,-23697,-23662,-23627,-23592,-23557,-23522,-23487,-23452,-23417,-23382,-23347,-23311,-23276,-23241,-23205,-23170,-23134,-23099,-23063,-23027,-22991,-22956,-22920,-22884,-22848,-22812,-22776,-22739,-22703,-22667,-22631,-22594,-22558,-22521,-22485,-22448,-22411,-22375,-22338,-22301,-22264,-22227,-22191,-22154,-22116,-22079,-22042,-22005,-21968,-21930,-21893,-21856,-21818,-21781,-21743,-21705,-21668,-21630,-21592,-21554,-21516,-21479,-21441,-21403,-21364,-21326,-21288,-21250,-21212,-21173,-21135,-21096,-21058,-21019,-20981,-20942,-20904,-20865,-20826,-20787,-20748,-20709,-20670,-20631,-20592,-20553,-20514,-20475,-20436,-20396,-20357,-20317,-20278,-20238,-20199,-20159,-20120,-20080,-20040,-20000,-19961,-19921,-19881,-19841,-19801,-19761,-19721,-19680,-19640,-19600,-19560,-19519,-19479,-19438,-19398,-19357,-19317,-19276,-19236,-19195,-19154,-19113,-19072,-19032,-18991,-18950,-18909,-18868,-18826,-18785,-18744,-18703,-18661,-18620,-18579,-18537,-18496,-18454,-18413,-18371,-18330,-18288,-18246,-18204,-18163,-18121,-18079,-18037,-17995,-17953,-17911,-17869,-17827,-17784,-17742,-17700,-17657,-17615,-17573,-17530,-17488,-17445,-17403,-17360,-17317,-17275,-17232,-17189,-17146,-17104,-17061,-17018,-16975,-16932,-16889,-16846,-16802,-16759,-16716,-16673,-16630,-16586,-16543,-16499,-16456,-16413,-16369,-16325,-16282,-16238,-16195,-16151,-16107,-16063,-16019,-15976,-15932,-15888,-15844,-15800,-15756,-15712,-15667,-15623,-15579,-15535,-15491,-15446,-15402,-15358,-15313,-15269,-15224,-15180,-15135,-15090,-15046,-15001,-14956,-14912,-14867,-14822,-14777,-14732,-14688,-14643,-14598,-14553,-14507,-14462,-14417,-14372,-14327,-14282,-14236,-14191,-14146,-14101,-14055,-14010,-13964,-13919,-13873,-13828,-13782,-13736,-13691,-13645,-13599,-13554,-13508,-13462,-13416,-13370,-13324,-13279,-13233,-13187,-13141,-13094,-13048,-13002,-12956,-12910,-12864,-12817,-12771,-12725,-12679,-12632,-12586,-12539,-12493,-12446,-12400,-12353,-12307,-12260,-12214,-12167,-12120,-12074,-12027,-11980,-11933,-11886,-11840,-11793,-11746,-11699,-11652,-11605,-11558,-11511,-11464,-11417,-11370,-11322,-11275,-11228,-11181,-11133,-11086,-11039,-10992,-10944,-10897,-10849,-10802,-10754,-10707,-10659,-10612,-10564,-10517,-10469,-10421,-10374,-10326,-10278,-10231,-10183,-10135,-10087,-10039,-9992,-9944,-9896,-9848,-9800,-9752,-9704,-9656,-9608,-9560,-9512,-9464,-9416,-9367,-9319,-9271,-9223,-9175,-9126,-9078,-9030,-8981,-8933,-8885,-8836,-8788,-8739,-8691,-8642,-8594,-8545,-8497,-8448,-8400,-8351,-8303,-8254,-8205,-8157,-8108,-8059,-8010,-7962,-7913,-7864,-7815,-7767,-7718,-7669,-7620,-7571,-7522,-7473,-7424,-7375,-7326,-7277,-7228,-7179,-7130,-7081,-7032,-6983,-6934,-6885,-6836,-6786,-6737,-6688,-6639,-6590,-6540,-6491,-6442,-6393,-6343,-6294,-6245,-6195,-6146,-6096,-6047,-5998,-5948,-5899,-5849,-5800,-5750,-5701,-5651,-5602,-5552,-5503,-5453,-5404,-5354,-5305,-5255,-5205,-5156,-5106,-5056,-5007,-4957,-4907,-4858,-4808,-4758,-4708,-4659,-4609,-4559,-4509,-4460,-4410,-4360,-4310,-4260,-4210,-4161,-4111,-4061,-4011,-3961,-3911,-3861,-3811,-3761,-3712,-3662,-3612,-3562,-3512,-3462,-3412,-3362,-3312,-3262,-3212,-3162,-3112,-3062,-3012,-2962,-2911,-2861,-2811,-2761,-2711,-2661,-2611,-2561,-2511,-2461,-2410,-2360,-2310,-2260,-2210,-2160,-2110,-2059,-2009,-1959,-1909,-1859,-1809,-1758,-1708,-1658,-1608,-1558,-1507,-1457,-1407,-1357,-1307,-1256,-1206,-1156,-1106,-1055,-1005,-955,-905,-854,-804,-754,-704,-653,-603,-553,-503,-452,-402,-352,-302,-251,-201,-151,-101,-50,
};

/* Function Define ************************************************************/
void bm_sin_test()
{
    float32 theta = -BM_PI * 123.205;

    printf("theta_x:%lu\r\n", sin_bm_x(theta));
    printf("theta_y:%d\r\n", sin_bm_y(theta));
    printf("sin_bm:%s cos_bm:%s\r\n", float2str(sin_bm(theta), 4), float2str(cos_bm(theta), 4));
    printf("cmath_sin:%s cmath_cos:%s\r\n", float2str(sin(theta), 4), float2str(cos(theta), 4));
    printf("sin_err:%s\r\n", float2str(sin_bm(theta) - sin(theta), 4));
    printf("cos_err:%s\r\n", float2str(cos_bm(theta) - cos(theta), 4));
}
void bm_sin_wave_test()
{
    volatile float theta = 0;
    static int32 tick = 0;
    volatile float a;
    const float step = BM_2PI * 30 * 1e-4;
    tick++;

    theta = fmodf(tick * step, BM_2PI);
    // a = sin(theta);
    a = sin_bm(theta);

    printf("%ld %ld %ld\r\n", tick, (int32)(theta * 100), (int32)(a * 100));
}

float bm_sqrt(float x)
{
    if (x == 0)
        return 0;

    float last = 0.0;
    float res = 1.0;

    while (res != last)
    {
        last = res;
        res = (res + x / res) / 2;
    }
    return res;
}

float bm_sqrt_carmack(float number)
{
    long i;
    float x, y;
    const float f = 1.5F;

    x = number * 0.5F;
    y = number;
    i = *(long *)&y;
    i = 0x5f3759df - (i >> 1); // 卡马克
    //   i  = 0x5f375a86 - ( i >> 1 );  //Lomont
    y = *(float *)&i;
    y = y * (f - (x * y * y));
    y = y * (f - (x * y * y));
    return number * y;
}

float bm_sin_fast(float x)
{
    float sin;

    // always wrap input angle to -PI..PI
    if (x < -BM_PI)
        x += BM_2PI;
    else if (x > BM_PI)
        x -= BM_2PI;

    // compute sine
    if (x < 0)
    {
        sin = 1.27323954 * x + .405284735 * x * x;

        if (sin < 0)
            sin = .225 * (sin * -sin - sin) + sin;
        else
            sin = .225 * (sin * sin - sin) + sin;
    }
    else
    {
        sin = 1.27323954 * x - 0.405284735 * x * x;

        if (sin < 0)
            sin = .225 * (sin * -sin - sin) + sin;
        else
            sin = .225 * (sin * sin - sin) + sin;
    }

    return sin;
}

float bm_cos_fast(float x)
{
    float cos;

    // always wrap input angle to -PI..PI
    if (x < -BM_PI)
        x += BM_2PI;
    else if (x > BM_PI)
        x -= BM_2PI;

    x += BM_PI_D2;
    if (x > BM_PI)
        x -= BM_2PI;

    if (x < 0)
    {
        cos = 1.27323954 * x + 0.405284735 * x * x;

        if (cos < 0)
            cos = .225 * (cos * -cos - cos) + cos;
        else
            cos = .225 * (cos * cos - cos) + cos;
    }
    else
    {
        cos = 1.27323954 * x - 0.405284735 * x * x;

        if (cos < 0)
            cos = .225 * (cos * -cos - cos) + cos;
        else
            cos = .225 * (cos * cos - cos) + cos;
    }

    return cos;
}

/* Kahan Summation */
float KahanSummation_Sum()
{
    float sum = 0.0f;
    float c = 0.0f;
    for (int i = 0; i < 200000000; i++)
    {
        float x = 0.1f;
        float y = x - c;
        float t = sum + y;
        c = t - sum - y;
        sum = t;
    }
    return sum;
}

float fsg0(float x, float d)
{
    return 0.5F * (sign_bm(x + d) - sign_bm(x - d));
}

float fsg(float x, float a, float b)
{
    return 0.5F * (sign_bm(x - a) - sign_bm(x - b));
}

float fdb0(float x, float d)
{
    return 0.5F * (sign_bm(x + d) + sign_bm(x - d));
}

float fss(float x, float a, float b)
{
    return sign_bm(x - a) * (1 - sign_bm(x - b)) / 2;
}

float fst0(float x, float d)
{
    return (fabsf(x + d) - fabsf(x - d)) / (2 * d);
}

float fal(float x, float a, float d)
{
    return x / (powf(d, 1 - a)) * fsg0(x, d) + fabsf(fdb0(x, d)) * powf(fabsf(x), a) * sign_bm(x);
}

#define POLY 0x07 // CRC-8: x^8 + x^2 + x^1 + 1
// #define POLY 0x31 // CRC-8: x^8 + x^5 + x^1 + 1
// #define POLY 0x5E // CRC-8: x^8 + x^6 + x^4 + x^3 + x^2 + x^1 + 1
uint8_t crc8_cal(const uint8_t *data, uint32_t len)
{
    uint8_t crc = 0;
    for (uint32_t i = 0; i < len; i++)
    {
        crc ^= data[i];
        for (uint32_t j = 0; j < 8; j++)
        {
            if (crc & 0x80)
            {
                crc = (crc << 1) ^ POLY;
            }
            else
            {
                crc <<= 1;
            }
        }
    }
    return crc;
}